|
|
|
@ -184,13 +184,15 @@
|
|
|
|
|
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
|
|
|
|
|
|
|
|
|
|
<% if attachmenttypes.any? %>
|
|
|
|
|
<label for="attachment_browse"><%=l(:attachment_browse)%></label>
|
|
|
|
|
<%= select_tag "attachment_browse", content_tag('option', '') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
|
|
|
|
|
|
|
|
|
|
<label for="attachment_browse_label"><%=l(:attachment_browse)%></label>
|
|
|
|
|
<%= select_tag "attachment_browse", content_tag('option',l(:attachment_all)) +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
|
|
|
|
|
:onchange=>"attachmenttypes_searchex(this.value)"%>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if sufixtypes.any? %>
|
|
|
|
|
<label for=""><%=l(:attachment_sufix_browse)%></label>
|
|
|
|
|
<%= select_tag "attach_sufix_browse", content_tag('option', '') +options_for_select(sufixtypes),
|
|
|
|
|
|
|
|
|
|
<label for="attach_sufix_browse_label"><%=l(:attachment_sufix_browse)%></label>
|
|
|
|
|
<%= select_tag "attach_sufix_browse", content_tag('option', l(:attachment_all)) +options_for_select(sufixtypes),
|
|
|
|
|
:onchange=>"attachment_contenttypes_searchex(this.value)"%>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
@ -286,7 +288,8 @@
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function attachmenttypes_searchex(value) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '<%=getattachtype_project_files_path(project_id: @project)%>' + '?type=' + encodeURIComponent(value),
|
|
|
|
|
url: '<%=getattachtype_project_files_path(project_id: @project)%>' + '?type='
|
|
|
|
|
+ encodeURIComponent(value) + "&contentType=" + $('#attach_sufix_browse').val(),
|
|
|
|
|
type: "POST"
|
|
|
|
|
|
|
|
|
|
}).complete(function (xhr, textStatus) {
|
|
|
|
@ -295,13 +298,14 @@
|
|
|
|
|
} else if (textStatus == 'error') {
|
|
|
|
|
alert('error');
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function attachment_contenttypes_searchex(value) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '<%=getattachtype_project_files_path(project_id: @project)%>' + '?type=' + encodeURIComponent(value),
|
|
|
|
|
|
|
|
|
|
url: '<%=getattachtype_project_files_path(project_id: @project)%>' + '?type='
|
|
|
|
|
+ $('#attachment_browse').val() + "&contentType=" + encodeURIComponent(value),
|
|
|
|
|
type: "POST"
|
|
|
|
|
|
|
|
|
|
}).complete(function (xhr, textStatus) {
|
|
|
|
|