Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/controllers/admin_controller.rb db/schema.rbdev_repository_hjq
commit
c1c05067e7
@ -0,0 +1,55 @@
|
||||
class OrganizationController < ApplicationController
|
||||
layout 'project_base'
|
||||
before_filter :require_admin, :except => [:index]
|
||||
|
||||
def index
|
||||
#@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
|
||||
@organizations = Organization.all
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@organizations = Organization.new
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@organizations = Organization.new
|
||||
@organizations.name = params[:organization][:name]
|
||||
if @organizations.save
|
||||
redirect_to admin_organization_url
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@organization = Organization.find params[:id]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
rescue Exception => e
|
||||
render_404
|
||||
end
|
||||
|
||||
def update
|
||||
@organization = Organization.find params[:id]
|
||||
@organization.name = params[:organization][:name]
|
||||
if @organization.save
|
||||
redirect_to admin_organization_url
|
||||
end
|
||||
rescue Exception => e
|
||||
render_404
|
||||
end
|
||||
|
||||
def destroy
|
||||
@organization = Organization.find params[:id]
|
||||
if @organization.destroy
|
||||
redirect_to admin_organization_url
|
||||
end
|
||||
rescue Exception => e
|
||||
render_404
|
||||
end
|
||||
end
|
@ -1,6 +0,0 @@
|
||||
class OrganizationsController < ApplicationController
|
||||
layout 'project_base'
|
||||
def index
|
||||
@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
|
||||
end
|
||||
end
|
@ -1,16 +0,0 @@
|
||||
module ExpireHelper
|
||||
#index.html 中 “projects”塊 緩存過期
|
||||
def expire_project_cache
|
||||
ActionController::Base.new.expire_fragment('projects')
|
||||
end
|
||||
|
||||
#index.html 中 “activities”塊 緩存過期
|
||||
def expire_activitie_cache
|
||||
ActionController::Base.new.expire_fragment('activities')
|
||||
end
|
||||
|
||||
#welcome/index.html 中 “forums”塊 緩存過期
|
||||
def expire_forum_cache
|
||||
ActionController::Base.new.expire_fragment('forums')
|
||||
end
|
||||
end
|
@ -1,10 +1,6 @@
|
||||
class ContestNotification < ActiveRecord::Base
|
||||
include ExpireHelper
|
||||
attr_accessible :content, :title
|
||||
validates :title, length: {maximum: 30}
|
||||
after_create :expire_forum_cache
|
||||
after_update :expire_forum_cache
|
||||
before_destroy :expire_forum_cache
|
||||
|
||||
|
||||
end
|
||||
|
@ -0,0 +1,22 @@
|
||||
# Time 2015-02-06 10:42:34
|
||||
# Author lizanle
|
||||
# Description 这是保存Project相关的动态的公共表
|
||||
class ForgeActivity < ActiveRecord::Base
|
||||
# 公共表中活动类型,命名规则:TYPE_OF_{类名}_ACT
|
||||
TYPE_OF_ISSUE_ACT = "Issue"
|
||||
TYPE_OF_MESSAGE_ACT = "Message"
|
||||
TYPE_OF_ATTACHMENT_ACT = "Attachment"
|
||||
TYPE_OF_DOCUMENT_ACT = "Document"
|
||||
TYPE_OF_JOURNAL_ACT = "Journal"
|
||||
TYPE_OF_WIKI_ACT = "Wiki"
|
||||
TYPE_OF_NEWS_ACT = "News"
|
||||
attr_accessible :forge_act_id, :forge_act_type,:project_id,:user_id,:org_id
|
||||
# 虚拟关联
|
||||
belongs_to :forge_act ,:polymorphic => true
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
validates :user_id,presence: true
|
||||
validates :project_id,presence: true
|
||||
validates :forge_act_id,presence: true
|
||||
validates :forge_act_type, presence: true
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class Organization < ActiveRecord::Base
|
||||
attr_accessible :logo_link, :name
|
||||
|
||||
has_many :projects
|
||||
end
|
@ -0,0 +1,43 @@
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_organization_new), new_organization_path, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h3>
|
||||
<%=l(:label_organization_list)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<%=l(:label_organization)%>
|
||||
</th>
|
||||
<th>
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @organizations.each do |org|%>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=org.name%>'>
|
||||
<span>
|
||||
<%= link_to org.name,home_path(:organization => org.id) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= format_date(org.created_at) %>
|
||||
</td>
|
||||
<td class="buttons">
|
||||
<%= link_to(l(:button_change), edit_organization_path(org.id), :class => 'icon icon-copy') %>
|
||||
<%= link_to(l(:button_delete), organization_path(org.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_project_plural)) -%>
|
@ -0,0 +1,250 @@
|
||||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<div id="resource_list">
|
||||
<% if @isproject %>
|
||||
<%= render :partial => 'project_file', locals: {project: @project} %>
|
||||
<% else %>
|
||||
<%= render :partial => 'course_file', locals: {course: @course} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var slideHeight = 29;
|
||||
function readmore(aNode) {
|
||||
// console.log(aNode)
|
||||
// var $td_tags_area = $(aNode).parent().parent();
|
||||
var $td_tags_area = $(aNode).parent().parent().parent().parent();
|
||||
var $tags_area = $td_tags_area.find('.tags_area')
|
||||
var $tags_gradint = $td_tags_area.find('.tags_gradint')
|
||||
var $read_more = $td_tags_area.find('.read-more')
|
||||
var $read_more_a = $td_tags_area.find('.read-more a')
|
||||
var $tags = $td_tags_area.find('#tags')
|
||||
var $icona = $td_tags_area.find('.tags_icona')
|
||||
|
||||
var slideHeight = 13; //px
|
||||
var defHeight = $tags.height();
|
||||
|
||||
var curHeight = $tags_area.height();
|
||||
if (curHeight == slideHeight) {
|
||||
$tags_area.animate({
|
||||
height: defHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('隐藏');
|
||||
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
|
||||
$tags_gradint.fadeOut();
|
||||
} else {
|
||||
$tags_area.animate({
|
||||
height: slideHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('更多');
|
||||
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
|
||||
$tags_gradint.fadeIn();
|
||||
}
|
||||
;
|
||||
|
||||
}
|
||||
$(function () {
|
||||
var slideHeight = 20; //px
|
||||
var defHeight = $('.tags_area').height();
|
||||
if (defHeight >= slideHeight) {
|
||||
$('.tags_area').css('height', slideHeight + 'px');
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
function eval_ajax(xhr, textStatus) {
|
||||
if (textStatus == 'success') {
|
||||
eval(xhr.responseText);
|
||||
} else if (textStatus == 'error') {
|
||||
alert('error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function attachment_contenttypes_searchex(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
|
||||
|
||||
function attachtype_edit(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function attachmenttypes_searchex(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: encodeURIComponent(value),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function course_attachmenttypes_searchex(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: encodeURIComponent(value),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function course_attachment_contenttypes_searchex(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
function course_attachtype_edit(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function attachmenttypes_change(id, type) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=updateType_attachments_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
|
||||
if (textStatus == 'success') {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
}).error(function () {
|
||||
alert('error');
|
||||
});
|
||||
} else if (textStatus == 'error') {
|
||||
alert('An error has occurred');
|
||||
}
|
||||
});
|
||||
<%end%>
|
||||
|
||||
}
|
||||
|
||||
function course_attachmenttypes_change(id, type) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=updateType_attachments_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
|
||||
if (textStatus == 'success') {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
}).error(function () {
|
||||
alert('error');
|
||||
});
|
||||
} else if (textStatus == 'error') {
|
||||
alert('An error has occurred');
|
||||
}
|
||||
});
|
||||
<%end%>
|
||||
|
||||
}
|
||||
|
||||
// 编辑文件密级
|
||||
function file_dense_edit(id, type) {
|
||||
$.ajax({
|
||||
url: '<%=updateFileDense_attachments_path%>',
|
||||
type: "POST",
|
||||
remote:"true",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type='text/javascript'>
|
||||
function tagAddClick(divid, objId, objTag) {
|
||||
alert("OK");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/users/tag_saveEx',
|
||||
data: {
|
||||
tagname: $('tag_name').value,
|
||||
obj_id: encodeURIComponent(objId),
|
||||
obj_flag: encodeURIComponent(objTag)
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
alert("OK");
|
||||
$(divid).empty();
|
||||
$(divid).html('123');
|
||||
$("#" + divid + " #name").val("");
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
@ -1,250 +1 @@
|
||||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<div id="resource_list">
|
||||
<% if @isproject %>
|
||||
<%= render :partial => 'project_file', locals: {project: @project} %>
|
||||
<% else %>
|
||||
<%= render :partial => 'course_file', locals: {course: @course} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var slideHeight = 29;
|
||||
function readmore(aNode) {
|
||||
// console.log(aNode)
|
||||
// var $td_tags_area = $(aNode).parent().parent();
|
||||
var $td_tags_area = $(aNode).parent().parent().parent().parent();
|
||||
var $tags_area = $td_tags_area.find('.tags_area')
|
||||
var $tags_gradint = $td_tags_area.find('.tags_gradint')
|
||||
var $read_more = $td_tags_area.find('.read-more')
|
||||
var $read_more_a = $td_tags_area.find('.read-more a')
|
||||
var $tags = $td_tags_area.find('#tags')
|
||||
var $icona = $td_tags_area.find('.tags_icona')
|
||||
|
||||
var slideHeight = 13; //px
|
||||
var defHeight = $tags.height();
|
||||
|
||||
var curHeight = $tags_area.height();
|
||||
if (curHeight == slideHeight) {
|
||||
$tags_area.animate({
|
||||
height: defHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('隐藏');
|
||||
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
|
||||
$tags_gradint.fadeOut();
|
||||
} else {
|
||||
$tags_area.animate({
|
||||
height: slideHeight
|
||||
}, 'normal');
|
||||
$read_more_a.html('更多');
|
||||
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
|
||||
$tags_gradint.fadeIn();
|
||||
}
|
||||
;
|
||||
|
||||
}
|
||||
$(function () {
|
||||
var slideHeight = 20; //px
|
||||
var defHeight = $('.tags_area').height();
|
||||
if (defHeight >= slideHeight) {
|
||||
$('.tags_area').css('height', slideHeight + 'px');
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
function eval_ajax(xhr, textStatus) {
|
||||
if (textStatus == 'success') {
|
||||
eval(xhr.responseText);
|
||||
} else if (textStatus == 'error') {
|
||||
alert('error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function attachment_contenttypes_searchex(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
|
||||
|
||||
function attachtype_edit(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function attachmenttypes_searchex(value) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: encodeURIComponent(value),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function course_attachmenttypes_searchex(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: encodeURIComponent(value),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function course_attachment_contenttypes_searchex(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
function course_attachtype_edit(value) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: encodeURIComponent(value)
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
<%end%>
|
||||
}
|
||||
|
||||
function attachmenttypes_change(id, type) {
|
||||
<% if @project%>
|
||||
$.ajax({
|
||||
url: '<%=updateType_attachments_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
|
||||
if (textStatus == 'success') {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
}).error(function () {
|
||||
alert('error');
|
||||
});
|
||||
} else if (textStatus == 'error') {
|
||||
alert('An error has occurred');
|
||||
}
|
||||
});
|
||||
<%end%>
|
||||
|
||||
}
|
||||
|
||||
function course_attachmenttypes_change(id, type) {
|
||||
<% if @course%>
|
||||
$.ajax({
|
||||
url: '<%=updateType_attachments_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
|
||||
if (textStatus == 'success') {
|
||||
$.ajax({
|
||||
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
type: $('#attachment_browse').val(),
|
||||
contentType: $('#attach_sufix_browse').val()
|
||||
}
|
||||
}).error(function () {
|
||||
alert('error');
|
||||
});
|
||||
} else if (textStatus == 'error') {
|
||||
alert('An error has occurred');
|
||||
}
|
||||
});
|
||||
<%end%>
|
||||
|
||||
}
|
||||
|
||||
// 编辑文件密级
|
||||
function file_dense_edit(id, type) {
|
||||
$.ajax({
|
||||
url: '<%=updateFileDense_attachments_path%>',
|
||||
type: "POST",
|
||||
remote:"true",
|
||||
data: {
|
||||
attachmentid: encodeURIComponent(id),
|
||||
newtype: encodeURIComponent(type)
|
||||
}
|
||||
|
||||
}).complete(function (xhr, textStatus) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type='text/javascript'>
|
||||
function tagAddClick(divid, objId, objTag) {
|
||||
alert("OK");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/users/tag_saveEx',
|
||||
data: {
|
||||
tagname: $('tag_name').value,
|
||||
obj_id: encodeURIComponent(objId),
|
||||
obj_flag: encodeURIComponent(objTag)
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
alert("OK");
|
||||
$(divid).empty();
|
||||
$(divid).html('123');
|
||||
$("#" + divid + " #name").val("");
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<%= render :partial => 'files/newfile_index' %>
|
@ -0,0 +1,2 @@
|
||||
alert("eeee");
|
||||
$('#content').html('<%= escape_javascript(render :partial => 'issues/newissue_index') %>');
|
@ -0,0 +1,137 @@
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">问题跟踪</h2>
|
||||
</div>
|
||||
<div class="problem_top">
|
||||
<% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %>
|
||||
<span>
|
||||
<%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,
|
||||
:html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, :class => 'icon icon-add' %>
|
||||
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
|
||||
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="problem_p fr">问题总数:<span>100</span> 未解决:<span>20</span></span>
|
||||
</div>
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||
<%= delete_link query_path(@query) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
||||
<div style="clear:right; ">
|
||||
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project}, :method => :get, :id => 'query_form', :class => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
|
||||
<div id="custom_query" class="custom_query" style="display: <%= !params[:utf8].blank? ? 'block' : 'none' %>;">
|
||||
<span>---<%= l :label_query_new %>---</span>
|
||||
|
||||
<div id="query_form_content" class="hide-when-print">
|
||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);">
|
||||
<%= l(:label_issue_query_condition) %>
|
||||
</legend>
|
||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!--
|
||||
<fieldset class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);">
|
||||
<%= l(:label_options) %>
|
||||
</legend>
|
||||
<div style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= l(:field_column_names) %></td>
|
||||
<td><%= render_query_columns_selection(@query) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for='group_by'><%= l(:field_group_by) %></label></td>
|
||||
<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect { |c| [c.caption, c.name.to_s] }, @query.group_by)) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= l(:button_show) %></td>
|
||||
<td><%= available_block_columns_tags(@query) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
-->
|
||||
<div class="buttons hide-when-print">
|
||||
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
||||
<%= link_to l(:label_issue_cancel_query), {:set_filter => 1, :project_id => @project}, :class => 'icon icon-reload' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
|
||||
<% if @query.valid? %>
|
||||
<% if @issues.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
|
||||
<div class="pagination">
|
||||
<ul><%= pagination_links_full @issue_pages, @issue_count %></ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="float: right; padding-top: 30px">
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
||||
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
|
||||
<%= f.link_to 'PDF', :url => params %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="csv-export-options" style="display:none;">
|
||||
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
|
||||
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'columns', 'all' %>
|
||||
<%= l(:description_all_columns) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
|
||||
<%= l(:field_description) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_issue_plural)) %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:controller => 'journals', :action => 'index',
|
||||
:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_changes_details)) %>
|
||||
<% end %>
|
||||
|
||||
<%= context_menu issues_context_menu_path %>
|
@ -1,135 +1 @@
|
||||
<div class="content-title-top">
|
||||
<% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %>
|
||||
<div>
|
||||
<%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,
|
||||
:html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, :class => 'icon icon-add' %>
|
||||
|
||||
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
|
||||
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||
<%= delete_link query_path(@query) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
||||
<div style="clear:right; ">
|
||||
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project}, :method => :get, :id => 'query_form', :class => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
|
||||
<div id="custom_query" class="custom_query" style="display: <%= !params[:utf8].blank? ? 'block' : 'none' %>;">
|
||||
<span>---<%= l :label_query_new %>---</span>
|
||||
|
||||
<div id="query_form_content" class="hide-when-print">
|
||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);">
|
||||
<%= l(:label_issue_query_condition) %>
|
||||
</legend>
|
||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!--
|
||||
<fieldset class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);">
|
||||
<%= l(:label_options) %>
|
||||
</legend>
|
||||
<div style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= l(:field_column_names) %></td>
|
||||
<td><%= render_query_columns_selection(@query) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for='group_by'><%= l(:field_group_by) %></label></td>
|
||||
<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect { |c| [c.caption, c.name.to_s] }, @query.group_by)) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= l(:button_show) %></td>
|
||||
<td><%= available_block_columns_tags(@query) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
-->
|
||||
<div class="buttons hide-when-print">
|
||||
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
||||
<%= link_to l(:label_issue_cancel_query), {:set_filter => 1, :project_id => @project}, :class => 'icon icon-reload' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
|
||||
<% if @query.valid? %>
|
||||
<% if @issues.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
|
||||
<div class="pagination">
|
||||
<ul><%= pagination_links_full @issue_pages, @issue_count %></ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="float: right; padding-top: 30px">
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
||||
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
|
||||
<%= f.link_to 'PDF', :url => params %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="csv-export-options" style="display:none;">
|
||||
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
|
||||
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'columns', 'all' %>
|
||||
<%= l(:description_all_columns) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
|
||||
<%= l(:field_description) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_issue_plural)) %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:controller => 'journals', :action => 'index',
|
||||
:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_changes_details)) %>
|
||||
<% end %>
|
||||
|
||||
<%= context_menu issues_context_menu_path %>
|
||||
<%= render :partial => 'issues/newissue_index' %>
|
@ -0,0 +1 @@
|
||||
$('#content').html('<%= escape_javascript(render :partial => 'issues/newissue_index') %>');
|
@ -1,22 +1,16 @@
|
||||
<div style="margin-left: 20px;">
|
||||
|
||||
<div class="pr_info_join fl">
|
||||
<!--关注项目-->
|
||||
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <!--added by linchun-->
|
||||
<span class="icon-fav icon"></span><%= watcher_link(@project, User.current) %>
|
||||
<span><%= watcher_link(@project, User.current) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--添加项目申请-->
|
||||
<div style="margin-left: 20px;">
|
||||
<!--加入项目 -->
|
||||
<% if ( !(User.current.member_of? @project) && User.current.login?) %>
|
||||
<span class="icon-fav icon"></span>
|
||||
<%= applied_link(@project, User.current) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!--添加退出项目-->
|
||||
<div style="margin-left: 20px;">
|
||||
<!--退出项目-->
|
||||
<% if ((User.current.member_of? @project) &&
|
||||
User.current.login? &&
|
||||
Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager") %>
|
||||
User.current.login? &&
|
||||
Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager") %>
|
||||
<%= exit_project_link(@project) %>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<title>
|
||||
<%= l(:label_all_enterprises) %>
|
||||
</title>
|
||||
<div class="content_syqy">
|
||||
<div class="list">
|
||||
<%= l(:label_all_enterprises) %>
|
||||
</div>
|
||||
<div class="syqy_box">
|
||||
<% if @organizations.empty? %>
|
||||
<h3>
|
||||
<%= l(:label_enterprise_nil) %>
|
||||
</h3>
|
||||
<% else %>
|
||||
<% @organizations.each do |organization| %>
|
||||
<% unless organization.name.blank? %>
|
||||
<ul>
|
||||
<li >
|
||||
<img src="/images/organization_logo.jpg" width="30" height="30" alt="<%= organization.name%>" />
|
||||
<%= link_to organization.name, home_path(:organization => organization.id) %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<div class="school-index">
|
||||
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||
</div>
|
||||
<% html_title(l(:label_enterprise_all)) -%>
|
@ -0,0 +1,18 @@
|
||||
<%= form_for(@organizations, :method => :post,
|
||||
:name => 'new_form',
|
||||
:url => {:controller => 'organization',
|
||||
:action => 'create'}) do |f|%>
|
||||
<h3>
|
||||
<%=l(:label_organization_new)%>
|
||||
</h3>
|
||||
<div class="box tabular" >
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<span style="padding-left: 60px">
|
||||
<%= submit_tag l(:button_create), :class => "enterprise"%>
|
||||
</span>
|
||||
</div>
|
||||
<%#= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_organization_new)) -%>
|
@ -1,23 +0,0 @@
|
||||
<title><%= l(:label_all_enterprises) %></title>
|
||||
<div class="content_syqy">
|
||||
<div class="list"><%= l(:label_all_enterprises) %></div>
|
||||
<div class="syqy_box">
|
||||
<% if @projects.count == 0 %>
|
||||
<h3><%= l(:label_enterprise_nil) %></h3>
|
||||
<% else %>
|
||||
<% @projects.each do |organization| %>
|
||||
<% unless organization.enterprise_name.blank? %>
|
||||
<ul>
|
||||
<li ><img src="/images/organization_logo.jpg" width="30" height="30" alt="#{project.enterprise_name}" />
|
||||
<%= link_to organization.enterprise_name, home_path(:organization => organization) %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<div class="school-index">
|
||||
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||
</div>
|
||||
<% html_title(l(:label_enterprise_all)) -%>
|
@ -1,6 +1,4 @@
|
||||
$("#polls_title").val("<%= @poll.polls_name%>");
|
||||
$("#polls_description").val("<%= @poll.polls_description %>");
|
||||
$("#polls_name_h").html("<%= @poll.polls_name %>");
|
||||
$("#polls_description_p").html("<%= @poll.polls_description %>");
|
||||
$("#polls_head_show").html("<%= escape_javascript(render :partial => 'show_head', :locals => {:poll => @poll}) %>");
|
||||
$("#polls_head_edit").html("<%= escape_javascript(render :partial => 'edit_head', :locals => {:poll => @poll}) %>");
|
||||
$("#polls_head_edit").hide();
|
||||
$("#polls_head_show").show();
|
@ -0,0 +1 @@
|
||||
$('#content').html('<%= escape_javascript(render :partial => 'projects/newproject_show') %>');
|
@ -0,0 +1,13 @@
|
||||
class CreateForgeActivities < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :forge_activities do |t|
|
||||
t.integer :user_id
|
||||
t.integer :project_id
|
||||
t.references :forge_act, polymorphic: true, index: true
|
||||
t.integer :org_id
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :forge_activities ,:forge_act_id
|
||||
end
|
||||
end
|
@ -0,0 +1,46 @@
|
||||
# Time 2015-02-37 15:03:42
|
||||
# Author lizanle
|
||||
# Description 将Issue中的数据导入forge_activities表
|
||||
class ImportIssueDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
issue_arr = select_all("SELECT\n" +
|
||||
" `issues`.`id` AS id,\n" +
|
||||
" `issues`.`project_id` AS project_id,\n" +
|
||||
" `issues`.`author_id` AS author_id,\n" +
|
||||
" `issues`.`created_on` AS created_on,\n" +
|
||||
" `issues`.`updated_on` AS updated_on\n" +
|
||||
"FROM\n" +
|
||||
" `issues`\n" +
|
||||
"LEFT OUTER JOIN `projects` ON `projects`.`id` = `issues`.`project_id`\n" +
|
||||
"LEFT OUTER JOIN `users` ON `users`.`id` = `issues`.`author_id`\n" +
|
||||
"AND `users`.`type` IN ('User', 'AnonymousUser')\n" +
|
||||
"LEFT OUTER JOIN `trackers` ON `trackers`.`id` = `issues`.`tracker_id`\n" +
|
||||
"WHERE\n" +
|
||||
" (\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'issue_tracking'\n" +
|
||||
" )\n" +
|
||||
" )");
|
||||
issue_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{Issue.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["updated_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_ISSUE_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,51 @@
|
||||
class AddJournalDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
journal_arr = select_all("SELECT\n" +
|
||||
" `journals`.`id` AS id,\n" +
|
||||
" `journals`.`created_on` AS created_on,\n" +
|
||||
" `projects`.`id` AS project_id,\n" +
|
||||
" `issues`.`updated_on` AS updated_on,\n" +
|
||||
" `users`.`id` AS author_id\n" +
|
||||
"FROM\n" +
|
||||
" `journals`\n" +
|
||||
"LEFT OUTER JOIN `issues` ON `issues`.`id` = `journals`.`journalized_id`\n" +
|
||||
"LEFT OUTER JOIN `projects` ON `projects`.`id` = `issues`.`project_id`\n" +
|
||||
"LEFT OUTER JOIN `journal_details` ON `journal_details`.`journal_id` = `journals`.`id`\n" +
|
||||
"LEFT OUTER JOIN `users` ON `users`.`id` = `journals`.`user_id`\n" +
|
||||
"AND `users`.`type` IN ('User', 'AnonymousUser')\n" +
|
||||
"WHERE\n" +
|
||||
" (\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'issue_tracking'\n" +
|
||||
" )\n" +
|
||||
" )\n" +
|
||||
" AND (\n" +
|
||||
" journals.journalized_type = 'Issue'\n" +
|
||||
" AND (\n" +
|
||||
" journal_details.prop_key = 'status_id'\n" +
|
||||
" OR journals.notes <> ''\n" +
|
||||
" )\n" +
|
||||
" )");
|
||||
journal_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{Journal.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["updated_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_JOURNAL_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,41 @@
|
||||
class ImportMessageDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
issue_arr = select_all("SELECT\n" +
|
||||
" `messages`.`id` AS id,\n" +
|
||||
" `messages`.`author_id` AS author_id,\n" +
|
||||
" `projects`.`id` AS project_id,\n" +
|
||||
" `messages`.`created_on` AS created_on,\n" +
|
||||
" `messages`.`updated_on` AS updated_on\n" +
|
||||
"FROM\n" +
|
||||
" `messages`\n" +
|
||||
"LEFT OUTER JOIN `boards` ON `boards`.`id` = `messages`.`board_id`\n" +
|
||||
"LEFT OUTER JOIN `projects` ON `projects`.`id` = `boards`.`project_id`\n" +
|
||||
"LEFT OUTER JOIN `users` ON `users`.`id` = `messages`.`author_id`\n" +
|
||||
"AND `users`.`type` IN ('User', 'AnonymousUser')\n" +
|
||||
"WHERE\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'boards'\n" +
|
||||
")");
|
||||
issue_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{Message.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["updated_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_MESSAGE_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,41 @@
|
||||
class ImportNewsDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
issue_arr = select_all("SELECT\n" +
|
||||
" `messages`.`id` AS id,\n" +
|
||||
" `messages`.`author_id` AS author_id,\n" +
|
||||
" `projects`.`id` AS project_id,\n" +
|
||||
" `messages`.`created_on` AS created_on,\n" +
|
||||
" `messages`.`updated_on` AS updated_on\n" +
|
||||
"FROM\n" +
|
||||
" `messages`\n" +
|
||||
"LEFT OUTER JOIN `boards` ON `boards`.`id` = `messages`.`board_id`\n" +
|
||||
"LEFT OUTER JOIN `projects` ON `projects`.`id` = `boards`.`project_id`\n" +
|
||||
"LEFT OUTER JOIN `users` ON `users`.`id` = `messages`.`author_id`\n" +
|
||||
"AND `users`.`type` IN ('User', 'AnonymousUser')\n" +
|
||||
"WHERE\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'boards'\n" +
|
||||
")");
|
||||
issue_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{News.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_NEWS_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class AddColumnProjectIssueIndexToIssues < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :issues, :project_issues_index, :integer
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class AddDataToProjectIssuesIndexsInIssue < ActiveRecord::Migration
|
||||
def change
|
||||
for i in 1 ... 1000 do i
|
||||
Issue.page(i).per(10).each do |e|
|
||||
index = e.project.issues.index(e).to_i + 1
|
||||
execute("update issues set project_issues_index = #{index} where id = #{e.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,37 @@
|
||||
class ImportDocumentDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
doc_arr = select_all("SELECT\n" +
|
||||
" `documents`.`id` AS id,\n" +
|
||||
" `documents`.`project_id` AS project_id,\n" +
|
||||
" `documents`.`created_on` AS created_on,\n" +
|
||||
" `documents`.`user_id` AS author_id\n" +
|
||||
"FROM\n" +
|
||||
" `documents`\n" +
|
||||
"LEFT OUTER JOIN `projects` ON `projects`.`id` = `documents`.`project_id`\n" +
|
||||
"WHERE\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'documents'\n" +
|
||||
")");
|
||||
doc_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{Document.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_DOCUMENT_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,43 @@
|
||||
class ImportAttachmentsDataToForgeActivities < ActiveRecord::Migration
|
||||
def up
|
||||
attach_arr = select_all("SELECT\n" +
|
||||
" attachments.author_id as author_id,\n" +
|
||||
" attachments.created_on as created_on,\n" +
|
||||
" attachments.id as id,\n" +
|
||||
" projects.id as project_id\n" +
|
||||
"FROM\n" +
|
||||
" `attachments`\n" +
|
||||
"LEFT JOIN versions ON attachments.container_type = 'Version'\n" +
|
||||
"AND versions.id = attachments.container_id\n" +
|
||||
"LEFT JOIN projects ON versions.project_id = projects.id\n" +
|
||||
"OR (\n" +
|
||||
" attachments.container_type = 'Project'\n" +
|
||||
" AND attachments.container_id = projects.id\n" +
|
||||
")\n" +
|
||||
"WHERE\n" +
|
||||
" projects. STATUS <> 9\n" +
|
||||
" AND projects.id IN (\n" +
|
||||
" SELECT\n" +
|
||||
" em.project_id\n" +
|
||||
" FROM\n" +
|
||||
" enabled_modules em\n" +
|
||||
" WHERE\n" +
|
||||
" em. NAME = 'files'\n" +
|
||||
" )");
|
||||
attach_arr.each do |e|
|
||||
ForgeActivity.connection.execute("insert into forge_activities(forge_act_id,
|
||||
forge_act_type,
|
||||
project_id,
|
||||
user_id,
|
||||
created_at,
|
||||
updated_at)
|
||||
values(#{e["id"]},'#{Attachment.to_s}',#{e["project_id"]},#{e["author_id"]},
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||
'#{e["created_on"].to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ForgeActivity.delete_all([" forge_act_type = ?",ForgeActivity::TYPE_OF_ATTACHMENT_ACT])
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class CreateOrganizations < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :organizations do |t|
|
||||
t.string :name
|
||||
t.string :logo_link
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class AddOrganizationToProject < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :projects, :organization_id, :integer
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :projects, :organization_id
|
||||
end
|
||||
end
|
@ -1,13 +0,0 @@
|
||||
lib/dalli.rb b1fd9d39df06608fcae5bcf46e9940f95b186d22
|
||||
lib/dalli/ring.rb e2cd42d8b963e669e2c8a83791fa56ec94f9ec55
|
||||
lib/dalli/server.rb a42d734f9b3d654886c86f04fb4f0352e7147b1e
|
||||
lib/dalli/client.rb 11afa0d702c68a151c87ea6e7ccdc863cf03884f
|
||||
lib/dalli/socket.rb 18b7243332ec2dafa9a17c195944e321b684e67e
|
||||
lib/dalli/options.rb d7ecb4c52b4ae2b222f319813234297e0951f82a
|
||||
lib/dalli/version.rb fff3231b7f52d7fa1dabb78bf1f67dcef95c5378
|
||||
lib/dalli/railtie.rb 63dc0fe85790a10225e867774f2c611d1c1ac46c
|
||||
lib/dalli/compressor.rb 13b0cf3f607bd8bc9f969679b0b6e9dcb0a059d7
|
||||
lib/dalli/cas/client.rb 983ded7ec738ed4502658150123e9c5ad7e3faa1
|
||||
lib/rack/session/dalli.rb 2696ad72e8f9d7f5ceb232db0c8d9a8916192edb
|
||||
lib/active_support/cache/dalli_store.rb 010d880e0f297d92b26c8f44e446add9d4fedfa2
|
||||
lib/action_dispatch/middleware/session/dalli_store.rb 62236273ea28a91502871f31aa600e038358931a
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue