##// END OF EJS Templates
Added an administration setting to allow issue start date to be defaulted to blank (nil) at issue creation (#2269)....
Etienne Massip -
r7613:269014ced887
parent child
Show More
@@ -314,7 +314,7 private
314 render_error l(:error_no_tracker_in_project)
314 render_error l(:error_no_tracker_in_project)
315 return false
315 return false
316 end
316 end
317 @issue.start_date ||= Date.today
317 @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?
318 if params[:issue].is_a?(Hash)
318 if params[:issue].is_a?(Hash)
319 @issue.safe_attributes = params[:issue]
319 @issue.safe_attributes = params[:issue]
320 if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record?
320 if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record?
@@ -5,6 +5,8
5
5
6 <p><%= setting_check_box :issue_group_assignment %></p>
6 <p><%= setting_check_box :issue_group_assignment %></p>
7
7
8 <p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
9
8 <p><%= setting_check_box :display_subprojects_issues %></p>
10 <p><%= setting_check_box :display_subprojects_issues %></p>
9
11
10 <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
12 <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
@@ -998,3 +998,4 bg:
998 description_date_range_interval: Изберете диапазон чрез задаване на начална и крайна дати
998 description_date_range_interval: Изберете диапазон чрез задаване на начална и крайна дати
999 description_date_from: Въведете начална дата
999 description_date_from: Въведете начална дата
1000 description_date_to: Въведете крайна дата
1000 description_date_to: Въведете крайна дата
1001 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1014,3 +1014,4 bs:
1014 label_parent_revision: Parent
1014 label_parent_revision: Parent
1015 label_child_revision: Child
1015 label_child_revision: Child
1016 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1016 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1017 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1003,3 +1003,4 ca:
1003 label_parent_revision: Parent
1003 label_parent_revision: Parent
1004 label_child_revision: Child
1004 label_child_revision: Child
1005 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1005 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1006 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1004,3 +1004,4 cs:
1004 label_parent_revision: Parent
1004 label_parent_revision: Parent
1005 label_child_revision: Child
1005 label_child_revision: Child
1006 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1006 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1007 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1017,3 +1017,4 da:
1017 label_parent_revision: Parent
1017 label_parent_revision: Parent
1018 label_child_revision: Child
1018 label_child_revision: Child
1019 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1019 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1020 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1021,3 +1021,4 de:
1021 label_parent_revision: Parent
1021 label_parent_revision: Parent
1022 label_child_revision: Child
1022 label_child_revision: Child
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1024 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1000,3 +1000,4 el:
1000 label_parent_revision: Parent
1000 label_parent_revision: Parent
1001 label_child_revision: Child
1001 label_child_revision: Child
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -370,6 +370,8 en-GB:
370 setting_commit_logtime_enabled: Enable time logging
370 setting_commit_logtime_enabled: Enable time logging
371 setting_commit_logtime_activity_id: Activity for logged time
371 setting_commit_logtime_activity_id: Activity for logged time
372 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
372 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
373 setting_issue_group_assignment: Allow issue assignment to groups
374 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
373
375
374 permission_add_project: Create project
376 permission_add_project: Create project
375 permission_add_subprojects: Create subprojects
377 permission_add_subprojects: Create subprojects
@@ -981,7 +983,6 en-GB:
981 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
983 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
982 notice_issue_successful_create: Issue %{id} created.
984 notice_issue_successful_create: Issue %{id} created.
983 label_between: between
985 label_between: between
984 setting_issue_group_assignment: Allow issue assignment to groups
985 label_diff: diff
986 label_diff: diff
986 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
987 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
987 description_query_sort_criteria_direction: Sort direction
988 description_query_sort_criteria_direction: Sort direction
@@ -375,6 +375,7 en:
375 setting_commit_logtime_activity_id: Activity for logged time
375 setting_commit_logtime_activity_id: Activity for logged time
376 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
376 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
377 setting_issue_group_assignment: Allow issue assignment to groups
377 setting_issue_group_assignment: Allow issue assignment to groups
378 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
378
379
379 permission_add_project: Create project
380 permission_add_project: Create project
380 permission_add_subprojects: Create subprojects
381 permission_add_subprojects: Create subprojects
@@ -1037,3 +1037,4 es:
1037 description_selected_columns: Selected Columns
1037 description_selected_columns: Selected Columns
1038 label_parent_revision: Parent
1038 label_parent_revision: Parent
1039 label_child_revision: Child
1039 label_child_revision: Child
1040 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1004,3 +1004,4 eu:
1004 label_parent_revision: Parent
1004 label_parent_revision: Parent
1005 label_child_revision: Child
1005 label_child_revision: Child
1006 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1006 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1007 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1003,3 +1003,4 fa:
1003 label_parent_revision: Parent
1003 label_parent_revision: Parent
1004 label_child_revision: Child
1004 label_child_revision: Child
1005 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1005 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1006 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1021,3 +1021,4 fi:
1021 label_parent_revision: Parent
1021 label_parent_revision: Parent
1022 label_child_revision: Child
1022 label_child_revision: Child
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1024 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -372,6 +372,7 fr:
372 setting_commit_logtime_activity_id: Activité pour le temps saisi
372 setting_commit_logtime_activity_id: Activité pour le temps saisi
373 setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
373 setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
374 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
374 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
375 setting_default_issue_start_date_to_creation_date: Donner à la date de début d'une nouvelle demande la valeur de la date du jour
375
376
376 permission_add_project: Créer un projet
377 permission_add_project: Créer un projet
377 permission_add_subprojects: Créer des sous-projets
378 permission_add_subprojects: Créer des sous-projets
@@ -1012,3 +1012,4 gl:
1012 label_parent_revision: Parent
1012 label_parent_revision: Parent
1013 label_child_revision: Child
1013 label_child_revision: Child
1014 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1014 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1015 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1005,3 +1005,4 he:
1005 label_parent_revision: Parent
1005 label_parent_revision: Parent
1006 label_child_revision: Child
1006 label_child_revision: Child
1007 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1007 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1008 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1007,3 +1007,4 hr:
1007 label_parent_revision: Parent
1007 label_parent_revision: Parent
1008 label_child_revision: Child
1008 label_child_revision: Child
1009 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1009 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1010 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1019,3 +1019,4
1019 label_parent_revision: Parent
1019 label_parent_revision: Parent
1020 label_child_revision: Child
1020 label_child_revision: Child
1021 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1021 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1022 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1008,3 +1008,4 id:
1008 label_parent_revision: Parent
1008 label_parent_revision: Parent
1009 label_child_revision: Child
1009 label_child_revision: Child
1010 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1010 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1011 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1001,3 +1001,4 it:
1001 label_parent_revision: Parent
1001 label_parent_revision: Parent
1002 label_child_revision: Child
1002 label_child_revision: Child
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1004 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1030,3 +1030,4 ja:
1030 description_wiki_subpages_reassign: Choose new parent page
1030 description_wiki_subpages_reassign: Choose new parent page
1031 description_selected_columns: Selected Columns
1031 description_selected_columns: Selected Columns
1032 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1032 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1033 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1052,3 +1052,4 ko:
1052 label_parent_revision: Parent
1052 label_parent_revision: Parent
1053 label_child_revision: Child
1053 label_child_revision: Child
1054 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1054 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1055 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1060,3 +1060,4 lt:
1060 label_parent_revision: Parent
1060 label_parent_revision: Parent
1061 label_child_revision: Child
1061 label_child_revision: Child
1062 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1062 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1063 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -995,3 +995,4 lv:
995 label_parent_revision: Parent
995 label_parent_revision: Parent
996 label_child_revision: Child
996 label_child_revision: Child
997 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
997 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
998 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1000,3 +1000,4 mk:
1000 label_parent_revision: Parent
1000 label_parent_revision: Parent
1001 label_child_revision: Child
1001 label_child_revision: Child
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1001,3 +1001,4 mn:
1001 label_parent_revision: Parent
1001 label_parent_revision: Parent
1002 label_child_revision: Child
1002 label_child_revision: Child
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1004 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -982,3 +982,4 nl:
982 label_parent_revision: Parent
982 label_parent_revision: Parent
983 label_child_revision: Child
983 label_child_revision: Child
984 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
984 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
985 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -990,3 +990,4
990 label_parent_revision: Parent
990 label_parent_revision: Parent
991 label_child_revision: Child
991 label_child_revision: Child
992 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
992 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
993 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1017,3 +1017,4 pl:
1017 label_parent_revision: Parent
1017 label_parent_revision: Parent
1018 label_child_revision: Child
1018 label_child_revision: Child
1019 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1019 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1020 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1021,3 +1021,4 pt-BR:
1021 label_parent_revision: Parent
1021 label_parent_revision: Parent
1022 label_child_revision: Child
1022 label_child_revision: Child
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1023 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1024 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1005,3 +1005,4 pt:
1005 label_parent_revision: Parent
1005 label_parent_revision: Parent
1006 label_child_revision: Child
1006 label_child_revision: Child
1007 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1007 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1008 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -993,3 +993,4 ro:
993 label_parent_revision: Parent
993 label_parent_revision: Parent
994 label_child_revision: Child
994 label_child_revision: Child
995 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
995 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
996 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1113,3 +1113,4 ru:
1113 label_parent_revision: Parent
1113 label_parent_revision: Parent
1114 label_child_revision: Child
1114 label_child_revision: Child
1115 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1115 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1116 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -995,3 +995,4 sk:
995 label_parent_revision: Parent
995 label_parent_revision: Parent
996 label_child_revision: Child
996 label_child_revision: Child
997 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
997 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
998 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1000,3 +1000,4 sl:
1000 label_parent_revision: Parent
1000 label_parent_revision: Parent
1001 label_child_revision: Child
1001 label_child_revision: Child
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1000,3 +1000,4 sr-YU:
1000 label_parent_revision: Parent
1000 label_parent_revision: Parent
1001 label_child_revision: Child
1001 label_child_revision: Child
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1002 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1001,3 +1001,4 sr:
1001 label_parent_revision: Parent
1001 label_parent_revision: Parent
1002 label_child_revision: Child
1002 label_child_revision: Child
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1003 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1004 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1041,3 +1041,4 sv:
1041 label_parent_revision: Parent
1041 label_parent_revision: Parent
1042 label_child_revision: Child
1042 label_child_revision: Child
1043 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1043 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1044 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -997,3 +997,4 th:
997 label_parent_revision: Parent
997 label_parent_revision: Parent
998 label_child_revision: Child
998 label_child_revision: Child
999 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
999 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1000 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1019,3 +1019,4 tr:
1019 label_parent_revision: Parent
1019 label_parent_revision: Parent
1020 label_child_revision: Child
1020 label_child_revision: Child
1021 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1021 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1022 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -996,3 +996,4 uk:
996 label_parent_revision: Parent
996 label_parent_revision: Parent
997 label_child_revision: Child
997 label_child_revision: Child
998 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
998 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
999 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1051,3 +1051,4 vi:
1051 label_parent_revision: Parent
1051 label_parent_revision: Parent
1052 label_child_revision: Child
1052 label_child_revision: Child
1053 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1053 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1054 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1080,3 +1080,4
1080 label_parent_revision: Parent
1080 label_parent_revision: Parent
1081 label_child_revision: Child
1081 label_child_revision: Child
1082 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1082 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1083 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -1002,3 +1002,4 zh:
1002 label_parent_revision: Parent
1002 label_parent_revision: Parent
1003 label_child_revision: Child
1003 label_child_revision: Child
1004 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1004 error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
1005 setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
@@ -123,6 +123,8 cross_project_issue_relations:
123 default: 0
123 default: 0
124 issue_group_assignment:
124 issue_group_assignment:
125 default: 0
125 default: 0
126 default_issue_start_date_to_creation_date:
127 default: 1
126 notified_events:
128 notified_events:
127 serialized: true
129 serialized: true
128 default:
130 default:
@@ -569,6 +569,30 class IssuesControllerTest < ActionController::TestCase
569 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
569 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
570 end
570 end
571
571
572 def test_get_new_without_default_start_date_is_creation_date
573 Setting.default_issue_start_date_to_creation_date = 0
574
575 @request.session[:user_id] = 2
576 get :new, :project_id => 1, :tracker_id => 1
577 assert_response :success
578 assert_template 'new'
579
580 assert_tag :tag => 'input', :attributes => { :name => 'issue[start_date]',
581 :value => nil }
582 end
583
584 def test_get_new_with_default_start_date_is_creation_date
585 Setting.default_issue_start_date_to_creation_date = 1
586
587 @request.session[:user_id] = 2
588 get :new, :project_id => 1, :tracker_id => 1
589 assert_response :success
590 assert_template 'new'
591
592 assert_tag :tag => 'input', :attributes => { :name => 'issue[start_date]',
593 :value => Date.today.to_s }
594 end
595
572 def test_get_new_form_should_allow_attachment_upload
596 def test_get_new_form_should_allow_attachment_upload
573 @request.session[:user_id] = 2
597 @request.session[:user_id] = 2
574 get :new, :project_id => 1, :tracker_id => 1
598 get :new, :project_id => 1, :tracker_id => 1
@@ -676,7 +700,9 class IssuesControllerTest < ActionController::TestCase
676 assert_equal group, issue.assigned_to
700 assert_equal group, issue.assigned_to
677 end
701 end
678
702
679 def test_post_create_without_start_date
703 def test_post_create_without_start_date_and_default_start_date_is_not_creation_date
704 Setting.default_issue_start_date_to_creation_date = 0
705
680 @request.session[:user_id] = 2
706 @request.session[:user_id] = 2
681 assert_difference 'Issue.count' do
707 assert_difference 'Issue.count' do
682 post :create, :project_id => 1,
708 post :create, :project_id => 1,
@@ -685,7 +711,6 class IssuesControllerTest < ActionController::TestCase
685 :subject => 'This is the test_new issue',
711 :subject => 'This is the test_new issue',
686 :description => 'This is the description',
712 :description => 'This is the description',
687 :priority_id => 5,
713 :priority_id => 5,
688 :start_date => '',
689 :estimated_hours => '',
714 :estimated_hours => '',
690 :custom_field_values => {'2' => 'Value for field 2'}}
715 :custom_field_values => {'2' => 'Value for field 2'}}
691 end
716 end
@@ -696,6 +721,27 class IssuesControllerTest < ActionController::TestCase
696 assert_nil issue.start_date
721 assert_nil issue.start_date
697 end
722 end
698
723
724 def test_post_create_without_start_date_and_default_start_date_is_creation_date
725 Setting.default_issue_start_date_to_creation_date = 1
726
727 @request.session[:user_id] = 2
728 assert_difference 'Issue.count' do
729 post :create, :project_id => 1,
730 :issue => {:tracker_id => 3,
731 :status_id => 2,
732 :subject => 'This is the test_new issue',
733 :description => 'This is the description',
734 :priority_id => 5,
735 :estimated_hours => '',
736 :custom_field_values => {'2' => 'Value for field 2'}}
737 end
738 assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id
739
740 issue = Issue.find_by_subject('This is the test_new issue')
741 assert_not_nil issue
742 assert_equal Date.today, issue.start_date
743 end
744
699 def test_post_create_and_continue
745 def test_post_create_and_continue
700 @request.session[:user_id] = 2
746 @request.session[:user_id] = 2
701 assert_difference 'Issue.count' do
747 assert_difference 'Issue.count' do
General Comments 0
You need to be logged in to leave comments. Login now