|
|
|
@ -45,9 +45,10 @@ class ProjectsController < ApplicationController
|
|
|
|
|
# menu_item l(:label_settings), :only => settings
|
|
|
|
|
|
|
|
|
|
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise]
|
|
|
|
|
before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
|
|
|
|
:statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
|
|
|
|
|
:show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
|
|
|
|
|
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
|
|
|
|
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
|
|
|
|
|
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
|
|
|
|
|
before_filter :authorize, :only => [:sort_project_demo, :show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen]
|
|
|
|
|
before_filter :authorize_global, :only => [:new, :create]
|
|
|
|
|
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
|
|
|
|
#by young
|
|
|
|
@ -558,7 +559,8 @@ class ProjectsController < ApplicationController
|
|
|
|
|
"show_documents" => true,
|
|
|
|
|
"show_messages" => true,
|
|
|
|
|
"show_news" => true,
|
|
|
|
|
"show_bids" => true
|
|
|
|
|
"show_bids" => true,
|
|
|
|
|
"show_journals_for_messages" => true
|
|
|
|
|
}
|
|
|
|
|
@date_to ||= Date.today + 1
|
|
|
|
|
@date_from = @date_to - @days
|
|
|
|
@ -569,6 +571,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
:with_subprojects => @with_subprojects,
|
|
|
|
|
:author => @author)
|
|
|
|
|
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
|
|
|
|
# logger.debug "=========================================#{@activity.scope}"
|
|
|
|
|
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
|
|
|
|
|
#Added by young
|
|
|
|
|
events = @activity.events(@date_from, @date_to)
|
|
|
|
@ -801,6 +804,35 @@ class ProjectsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def finishcourse
|
|
|
|
|
course_prefs = Course.find_by_extra(@project.identifier)
|
|
|
|
|
# setup_time = Time.parse(course_prefs.setup_time)
|
|
|
|
|
# end_time = Time.parse(course_prefs.endup_time)
|
|
|
|
|
yesterday = Date.today.prev_day.to_time
|
|
|
|
|
|
|
|
|
|
course_prefs.endup_time = yesterday
|
|
|
|
|
@save_flag = course_prefs.save
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def restartcourse
|
|
|
|
|
course_prefs = Course.find_by_extra(@project.identifier)
|
|
|
|
|
day = Time.parse("3000-01-01")
|
|
|
|
|
|
|
|
|
|
course_prefs.endup_time = day
|
|
|
|
|
@save_flag = course_prefs.save
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js {
|
|
|
|
|
render action:'finishcourse'
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
# Validates parent_id param according to user's permissions
|
|
|
|
|