diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 1fbcec3ec..efe32a80b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -344,7 +344,7 @@ class ProjectsController < ApplicationController @course_tag = params[:project][:project_type] if(@course_tag=="1") @course = Course.new - @course.extra=params[:project][:identifier] + @course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s @course.safe_attributes = params[:project][:course] @course.tea_id = User.current.id @course.save @@ -355,6 +355,9 @@ class ProjectsController < ApplicationController @trackers = Tracker.sorted.all @project = Project.new @project.safe_attributes = params[:project] + if @course_tag == '1' + @project.identifier = @course.extra + end if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb index 5a346f735..6fb8ad996 100644 --- a/app/views/projects/_course_form.html.erb +++ b/app/views/projects/_course_form.html.erb @@ -6,10 +6,10 @@
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
-<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %> + <%= f.fields_for @course do |m| %>