Reenabled notifications.

This commit is contained in:
Martin Edenhofer 2012-04-16 14:56:04 +02:00
parent 879ba366ab
commit 5de91cae96
3 changed files with 20 additions and 4 deletions

View file

@ -27,13 +27,17 @@ class TicketArticlesController < ApplicationController
) )
if @article.save if @article.save
render :json => @article, :status => :created
# remove attachments from upload cache # remove attachments from upload cache
Store.remove( Store.remove(
:object => 'UploadCache::TicketZoom::' + current_user.id.to_s, :object => 'UploadCache::TicketZoom::' + current_user.id.to_s,
:o_id => @article.ticket_id :o_id => @article.ticket_id
) )
# execute ticket events
Ticket::Observer::Notification.transaction
render :json => @article, :status => :created
else else
render :json => @article.errors, :status => :unprocessable_entity render :json => @article.errors, :status => :unprocessable_entity
end end
@ -44,6 +48,10 @@ class TicketArticlesController < ApplicationController
@article = Ticket::Article.find(params[:id]) @article = Ticket::Article.find(params[:id])
if @article.update_attributes(params[:ticket_article]) if @article.update_attributes(params[:ticket_article])
# execute ticket events
Ticket::Observer::Notification.transaction
render :json => @article, :status => :ok render :json => @article, :status => :ok
else else
render :json => @article.errors, :status => :unprocessable_entity render :json => @article.errors, :status => :unprocessable_entity

View file

@ -56,6 +56,9 @@ class TicketsController < ApplicationController
) )
end end
# execute ticket events
Ticket::Observer::Notification.transaction
render :json => @ticket, :status => :created render :json => @ticket, :status => :created
end end
@ -64,6 +67,10 @@ class TicketsController < ApplicationController
@ticket = Ticket.find(params[:id]) @ticket = Ticket.find(params[:id])
if @ticket.update_attributes(params[:ticket]) if @ticket.update_attributes(params[:ticket])
# execute ticket events
Ticket::Observer::Notification.transaction
render :json => @ticket, :status => :ok render :json => @ticket, :status => :ok
else else
render :json => @ticket.errors, :status => :unprocessable_entity render :json => @ticket.errors, :status => :unprocessable_entity
@ -75,6 +82,9 @@ class TicketsController < ApplicationController
@ticket = Ticket.find(params[:id]) @ticket = Ticket.find(params[:id])
@ticket.destroy @ticket.destroy
# execute ticket events
Ticket::Observer::Notification.transaction
head :ok head :ok
end end
end end

View file

@ -117,8 +117,6 @@ class Channel::EmailParser
) )
end end
end end
return true
end end
# execute ticket events # execute ticket events