|
|
@ -33,6 +33,7 @@ class OrgSubfieldsController < ApplicationController
|
|
|
|
domain = Secdomain.where("subname=?", request.subdomain).first
|
|
|
|
domain = Secdomain.where("subname=?", request.subdomain).first
|
|
|
|
@organization = Organization.find(domain.pid)
|
|
|
|
@organization = Organization.find(domain.pid)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization)
|
|
|
|
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
|
|
|
|
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
|
|
|
|
"subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+
|
|
|
|
"subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+
|
|
|
|
" org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'").first
|
|
|
|
" org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'").first
|
|
|
@ -82,12 +83,15 @@ class OrgSubfieldsController < ApplicationController
|
|
|
|
sort = "#{Attachment.table_name}.created_on desc"
|
|
|
|
sort = "#{Attachment.table_name}.created_on desc"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@container_type = 2
|
|
|
|
@container_type = 2
|
|
|
|
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
|
|
|
|
@containers = [OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
|
|
|
|
@organization = Organization.find(@containers.first.organization_id)
|
|
|
|
@organization = Organization.find(@containers.first.organization_id)
|
|
|
|
show_attachments @containers
|
|
|
|
show_attachments @containers
|
|
|
|
@tag_list = attachment_tag_list @all_attachments
|
|
|
|
@tag_list = attachment_tag_list @all_attachments
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@page = params[:page] || 1
|
|
|
|
@page = params[:page] || 1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
render_403
|
|
|
|
|
|
|
|
end
|
|
|
|
#render :layout => 'base_org'
|
|
|
|
#render :layout => 'base_org'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|