|
|
@ -2897,183 +2897,75 @@ int main(int argc, char** argv){
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def user_url_in_org(user_id)
|
|
|
|
def user_url_in_org(user_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + user_id.to_s
|
|
|
|
return "http://localhost:3000/users/" + user_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://www.test.forge.trustie.net/users/" + user_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/users/" + user_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def project_issues_url_in_org(project_id)
|
|
|
|
def project_issues_url_in_org(project_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/projects/" + project_id.to_s + "/issues"
|
|
|
|
return "http://localhost:3000/projects/" + project_id.to_s + "/issues"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://www.test.forge.trustie.net/projects/" + project_id.to_s + "/issues"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/projects/" + project_id.to_s + "/issues"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def issue_url_in_org(id)
|
|
|
|
def issue_url_in_org(id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/issues/" + id.to_s
|
|
|
|
return "http://localhost:3000/issues/" + id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://www.test.forge.trustie.net/issues/" + id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/issues/" + id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def project_boards_url_in_org(id)
|
|
|
|
def project_boards_url_in_org(id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/projects/" + id.to_s + "/boards"
|
|
|
|
return "http://localhost:3000/projects/" + id.to_s + "/boards"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://www.test.forge.trustie.net/projects/" + id.to_s + "/boards"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/projects/" + id.to_s + "/boards"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def board_message_url_in_org(board_id, message_id)
|
|
|
|
def board_message_url_in_org(board_id, message_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/boards/" + board_id.to_s + "/topics/" + message_id.to_s
|
|
|
|
return "http://localhost:3000/boards/" + board_id.to_s + "/topics/" + message_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://www.test.forge.trustie.net/boards/" + board_id.to_s + "/topics/" + message_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/boards/" + board_id.to_s + "/topics/" + message_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def project_url_in_org(id)
|
|
|
|
def project_url_in_org(id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/projects/" + id.to_s
|
|
|
|
return "http://localhost:3000/projects/" + id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/projects/" + id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/projects/" + id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def homework_common_index_url_in_org(course_id)
|
|
|
|
def homework_common_index_url_in_org(course_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/homework_common?course=" + course_id.to_s
|
|
|
|
return "http://localhost:3000/homework_common?course=" + course_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/homework_common?course=" + course_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/homework_common?course=" + course_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def student_work_index_url_in_org(homework_id)
|
|
|
|
def student_work_index_url_in_org(homework_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/student_work?homework=" + homework_id.to_s
|
|
|
|
return "http://localhost:3000/student_work?homework=" + homework_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/student_work?homework=" + course_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/student_work?homework=" + course_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def course_url_in_org(course_id)
|
|
|
|
def course_url_in_org(course_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/courses/" + course_id.to_s
|
|
|
|
return "http://localhost:3000/courses/" + course_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/courses/" + course_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/courses/" + course_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def user_watchlist_url_in_org(id)
|
|
|
|
def user_watchlist_url_in_org(id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + id.to_s + "/user_watchlist"
|
|
|
|
return "http://localhost:3000/users/" + id.to_s + "/user_watchlist"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/users/" + id.to_s + "/user_watchlist"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/users/" + id.to_s + "/user_watchlist"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def user_fanslist_url_in_org(id)
|
|
|
|
def user_fanslist_url_in_org(id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + id.to_s + "/user_fanslist"
|
|
|
|
return "http://localhost:3000/users/" + id.to_s + "/user_fanslist"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/users/" + id.to_s + "/user_fanslist"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/users/" + id.to_s + "/user_fanslist"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def user_blogs_url_in_org(user_id)
|
|
|
|
def user_blogs_url_in_org(user_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + user_id.to_s + "/blogs"
|
|
|
|
return "http://localhost:3000/users/" + user_id.to_s + "/blogs"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/users/" + user_id.to_s + "/blogs"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/users/" + user_id.to_s + "/blogs"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def feedback_url_in_org(user_id)
|
|
|
|
def feedback_url_in_org(user_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + user_id.to_s + "/user_newfeedback"
|
|
|
|
return "http://localhost:3000/users/" + user_id.to_s + "/user_newfeedback"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/users/" + user_id.to_s + "/user_newfeedback"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/users/" + user_id.to_s + "/user_newfeedback"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def user_activities_url_in_org(user_id)
|
|
|
|
def user_activities_url_in_org(user_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/users/" + user_id.to_s + "/user_activities"
|
|
|
|
return "http://localhost:3000/users/" + user_id.to_s + "/user_activities"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "http://test.forge.trustie.net/users/" + user_id.to_s + "/user_activities"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "http://www.trustie.net/users/" + user_id.to_s + "/user_activities"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def course_news_index_url_in_org(course_id)
|
|
|
|
def course_news_index_url_in_org(course_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/courses/" + course_id.to_s + "/news"
|
|
|
|
return "http://localhost:3000/courses/" + course_id.to_s + "/news"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/courses/" + course_id.to_s + "/news"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/courses/" + course_id.to_s + "/news"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def news_url_in_org(news_id)
|
|
|
|
def news_url_in_org(news_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/news/" + news_id.to_s
|
|
|
|
return "http://localhost:3000/news/" + news_id.to_s
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/news/" + news_id.to_s
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/news/" + news_id.to_s
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def course_boards_url_in_org(course_id)
|
|
|
|
def course_boards_url_in_org(course_id)
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/courses/" + course_id.to_s + "/boards"
|
|
|
|
return "http://localhost:3000/courses/" + course_id.to_s + "/boards"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/courses/" + course_id.to_s + "/boards"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/courses/" + course_id.to_s + "/boards"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def logout_url_without_domain
|
|
|
|
def logout_url_without_domain
|
|
|
|
if Rails.env.development?
|
|
|
|
Setting.host_name + "/logout"
|
|
|
|
return "http://localhost:3000/logout"
|
|
|
|
|
|
|
|
elsif Rails.env.test?
|
|
|
|
|
|
|
|
return "https://test.forge.trustie.net/logout"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return "https://www.trustie.net/logout"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#判断是否为默认的组织栏目
|
|
|
|
#判断是否为默认的组织栏目
|
|
|
|