project leave message.

This commit is contained in:
yanxd 2013-12-30 08:47:45 +08:00
parent 1d962b98d3
commit 4c4e725b5c
3 changed files with 6 additions and 3 deletions

View File

@ -299,7 +299,7 @@ class ProjectsController < ApplicationController
def project_respond def project_respond
# will_reply = JournalsForMessage.find(params[:reference_id]) if params[:reference_id] # will_reply = JournalsForMessage.find(params[:reference_id]) if params[:reference_id]
project_id = request.headers["Referer"].match((%r|/([0-9]{1,})/|))[1] project_id = request.headers["Referer"].match((%r|/([0-9]{1,})/|))[1]
@project = Project.find(project_id) # @project = Project.find_by_id(project_id)
parent_id = params[:reference_id] parent_id = params[:reference_id]
author_id = User.current.id author_id = User.current.id
reply_user_id = params[:reference_user_id] reply_user_id = params[:reference_user_id]
@ -312,13 +312,14 @@ class ProjectsController < ApplicationController
:notes => content, :notes => content,
:is_readed => false} :is_readed => false}
@jfm = @project.add_new_jour(nil, nil, nil, options) @jfm = Project.add_new_jour(nil, nil, project_id, options)
# flash[:notice]=l(:label_projects_feedback_respond_success) # flash[:notice]=l(:label_projects_feedback_respond_success)
respond_to do |format| respond_to do |format|
format.html { redirect_to :back } format.html { redirect_to :back }
format.js
#format.api { render_api_ok } #format.api { render_api_ok }
end end
end end

View File

@ -6,6 +6,8 @@
:maxlength => 250 %> :maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%> <%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%>
<%end%> <%end%>

View File

@ -44,7 +44,7 @@
<tr> <tr>
<td colspan='2'> <td colspan='2'>
<div id=<%= ids%> style="display: none"> <div id=<%= ids%> style="display: none">
<%= render :partial => 'new_respond', :locals => {:journal => journal} %> <%= render :partial => 'new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div></td> </div></td>
</tr> </tr>
</table></td> </table></td>