You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes_helper.rb 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # frozen_string_literal: true
  2. # Redmine - project management software
  3. # Copyright (C) 2006-2021 Jean-Philippe Lang
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License
  7. # as published by the Free Software Foundation; either version 2
  8. # of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. module RoutesHelper
  19. # Returns the path to project issues or to the cross-project
  20. # issue list if project is nil
  21. def _project_issues_path(project, *args)
  22. if project
  23. project_issues_path(project, *args)
  24. else
  25. issues_path(*args)
  26. end
  27. end
  28. def _project_news_path(project, *args)
  29. if project
  30. project_news_index_path(project, *args)
  31. else
  32. news_index_path(*args)
  33. end
  34. end
  35. def _new_project_issue_path(project, *args)
  36. if project
  37. new_project_issue_path(project, *args)
  38. else
  39. new_issue_path(*args)
  40. end
  41. end
  42. def _project_calendar_path(project, *args)
  43. project ? project_calendar_path(project, *args) : issues_calendar_path(*args)
  44. end
  45. def _project_gantt_path(project, *args)
  46. project ? project_gantt_path(project, *args) : issues_gantt_path(*args)
  47. end
  48. def _time_entries_path(project, issue, *args)
  49. if project
  50. project_time_entries_path(project, *args)
  51. else
  52. time_entries_path(*args)
  53. end
  54. end
  55. def _report_time_entries_path(project, issue, *args)
  56. if project
  57. report_project_time_entries_path(project, *args)
  58. else
  59. report_time_entries_path(*args)
  60. end
  61. end
  62. def _new_time_entry_path(project, issue, *args)
  63. if issue
  64. new_issue_time_entry_path(issue, *args)
  65. elsif project
  66. new_project_time_entry_path(project, *args)
  67. else
  68. new_time_entry_path(*args)
  69. end
  70. end
  71. def board_path(board, *args)
  72. project_board_path(board.project, board, *args)
  73. end
  74. end