render_error l(:error_no_tracker_in_project)
return false
end
- @issue.start_date ||= Date.today
+ @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?
if params[:issue].is_a?(Hash)
@issue.safe_attributes = params[:issue]
if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record?
<p><%= setting_check_box :issue_group_assignment %></p>
+<p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
+
<p><%= setting_check_box :display_subprojects_issues %></p>
<p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
description_date_range_interval: Изберете диапазон чрез задаване на начална и крайна дати
description_date_from: Въведете начална дата
description_date_to: Въведете крайна дата
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
setting_commit_logtime_enabled: Enable time logging
setting_commit_logtime_activity_id: Activity for logged time
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
-
+ setting_issue_group_assignment: Allow issue assignment to groups
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
+
permission_add_project: Create project
permission_add_subprojects: Create subprojects
permission_edit_project: Edit project
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
notice_issue_successful_create: Issue %{id} created.
label_between: between
- setting_issue_group_assignment: Allow issue assignment to groups
label_diff: diff
text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
description_query_sort_criteria_direction: Sort direction
setting_commit_logtime_activity_id: Activity for logged time
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
setting_issue_group_assignment: Allow issue assignment to groups
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
permission_add_project: Create project
permission_add_subprojects: Create subprojects
description_selected_columns: Selected Columns
label_parent_revision: Parent
label_child_revision: Child
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
setting_commit_logtime_activity_id: Activité pour le temps saisi
setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
+ 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
permission_add_project: Créer un projet
permission_add_subprojects: Créer des sous-projets
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
description_wiki_subpages_reassign: Choose new parent page
description_selected_columns: Selected Columns
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
label_parent_revision: Parent
label_child_revision: Child
error_scm_annotate_big_text_file: The entry cannot be annotated, as it exceeds the maximum text file size.
+ setting_default_issue_start_date_to_creation_date: Set new issue's start date with today's date value
default: 0
issue_group_assignment:
default: 0
+default_issue_start_date_to_creation_date:
+ default: 1
notified_events:
serialized: true
default:
:parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
end
+ def test_get_new_without_default_start_date_is_creation_date
+ Setting.default_issue_start_date_to_creation_date = 0
+
+ @request.session[:user_id] = 2
+ get :new, :project_id => 1, :tracker_id => 1
+ assert_response :success
+ assert_template 'new'
+
+ assert_tag :tag => 'input', :attributes => { :name => 'issue[start_date]',
+ :value => nil }
+ end
+
+ def test_get_new_with_default_start_date_is_creation_date
+ Setting.default_issue_start_date_to_creation_date = 1
+
+ @request.session[:user_id] = 2
+ get :new, :project_id => 1, :tracker_id => 1
+ assert_response :success
+ assert_template 'new'
+
+ assert_tag :tag => 'input', :attributes => { :name => 'issue[start_date]',
+ :value => Date.today.to_s }
+ end
+
def test_get_new_form_should_allow_attachment_upload
@request.session[:user_id] = 2
get :new, :project_id => 1, :tracker_id => 1
assert_equal group, issue.assigned_to
end
- def test_post_create_without_start_date
+ def test_post_create_without_start_date_and_default_start_date_is_not_creation_date
+ Setting.default_issue_start_date_to_creation_date = 0
+
@request.session[:user_id] = 2
assert_difference 'Issue.count' do
post :create, :project_id => 1,
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5,
- :start_date => '',
:estimated_hours => '',
:custom_field_values => {'2' => 'Value for field 2'}}
end
assert_nil issue.start_date
end
+ def test_post_create_without_start_date_and_default_start_date_is_creation_date
+ Setting.default_issue_start_date_to_creation_date = 1
+
+ @request.session[:user_id] = 2
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 3,
+ :status_id => 2,
+ :subject => 'This is the test_new issue',
+ :description => 'This is the description',
+ :priority_id => 5,
+ :estimated_hours => '',
+ :custom_field_values => {'2' => 'Value for field 2'}}
+ end
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id
+
+ issue = Issue.find_by_subject('This is the test_new issue')
+ assert_not_nil issue
+ assert_equal Date.today, issue.start_date
+ end
+
def test_post_create_and_continue
@request.session[:user_id] = 2
assert_difference 'Issue.count' do