Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
c233776905
4 changed files with 17 additions and 37 deletions
|
@ -305,9 +305,9 @@ returns
|
||||||
|
|
||||||
lookup model from cache (if exists) or retrieve it from db, id, name or login possible
|
lookup model from cache (if exists) or retrieve it from db, id, name or login possible
|
||||||
|
|
||||||
result = Model.lookup( :id => 123 )
|
result = Model.lookup(id: 123)
|
||||||
result = Model.lookup( :name => 'some name' )
|
result = Model.lookup(name: 'some name')
|
||||||
result = Model.lookup( :login => 'some login' )
|
result = Model.lookup(login: 'some login')
|
||||||
|
|
||||||
returns
|
returns
|
||||||
|
|
||||||
|
@ -681,10 +681,10 @@ class OwnModel < ApplicationModel
|
||||||
serve methode to configure and enable search index support for this model
|
serve methode to configure and enable search index support for this model
|
||||||
|
|
||||||
class Model < ApplicationModel
|
class Model < ApplicationModel
|
||||||
search_index_support :ignore_attributes => {
|
search_index_support ignore_attributes: {
|
||||||
:create_article_type_id => true,
|
create_article_type_id: true,
|
||||||
:create_article_sender_id => true,
|
create_article_sender_id: true,
|
||||||
:article_count => true,
|
article_count: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -748,7 +748,7 @@ reload search index with full data
|
||||||
serve methode to configure and enable activity stream support for this model
|
serve methode to configure and enable activity stream support for this model
|
||||||
|
|
||||||
class Model < ApplicationModel
|
class Model < ApplicationModel
|
||||||
activity_stream_support :role => 'Admin'
|
activity_stream_support role: 'Admin'
|
||||||
end
|
end
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -835,7 +835,7 @@ class Model < ApplicationModel
|
||||||
end
|
end
|
||||||
|
|
||||||
class Model < ApplicationModel
|
class Model < ApplicationModel
|
||||||
history_support :ignore_attributes => { :article_count => true }
|
history_support ignore_attributes: { article_count: true }
|
||||||
end
|
end
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -1012,8 +1012,8 @@ return object and assets
|
||||||
|
|
||||||
data = Model.full(123)
|
data = Model.full(123)
|
||||||
data = {
|
data = {
|
||||||
:id => 123,
|
id: 123,
|
||||||
:assets => assets,
|
assets: assets,
|
||||||
}
|
}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
|
@ -84,14 +84,6 @@ returns
|
||||||
|
|
||||||
def search_index_attribute_lookup(attributes, ref_object)
|
def search_index_attribute_lookup(attributes, ref_object)
|
||||||
|
|
||||||
# default keep attributes
|
|
||||||
keep_attributes = {}
|
|
||||||
if self.class.search_index_support_config[:keep_attributes]
|
|
||||||
self.class.search_index_support_config[:keep_attributes].each {|key, value|
|
|
||||||
keep_attributes[key] = value
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
attributes_new = {}
|
attributes_new = {}
|
||||||
attributes.each {|key, value|
|
attributes.each {|key, value|
|
||||||
next if !value
|
next if !value
|
||||||
|
|
|
@ -229,11 +229,10 @@ class Observer::Ticket::Notification::BackgroundJob
|
||||||
def template_create(user, ticket, article, _ticket_changes)
|
def template_create(user, ticket, article, _ticket_changes)
|
||||||
article_content = ''
|
article_content = ''
|
||||||
if article
|
if article
|
||||||
article_content = '<snip>
|
article_content = 'i18n(Information):
|
||||||
<blockquote type="cite">
|
<blockquote type="cite">
|
||||||
#{article.body.text2html}
|
#{article.body.text2html}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</snip>
|
|
||||||
<br>
|
<br>
|
||||||
<br>'
|
<br>'
|
||||||
end
|
end
|
||||||
|
@ -295,11 +294,10 @@ State: i18n(#{ticket.state.name.text2html})<br>
|
||||||
}
|
}
|
||||||
article_content = ''
|
article_content = ''
|
||||||
if article
|
if article
|
||||||
article_content = '<snip>
|
article_content = 'i18n(Information):
|
||||||
<blockquote type="cite">
|
<blockquote type="cite">
|
||||||
#{article.body.text2html}
|
#{article.body.text2html}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</snip>
|
|
||||||
<br>
|
<br>
|
||||||
<br>'
|
<br>'
|
||||||
end
|
end
|
||||||
|
@ -312,7 +310,7 @@ Ticket (#{ticket.title.text2html}) wurde von "<b>#{ticket.updated_by.fullname.te
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div>
|
<div>
|
||||||
Änderungen:<br>
|
i18n(Changes):<br>
|
||||||
' + changes + '
|
' + changes + '
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -329,7 +327,7 @@ Ticket (#{ticket.title.text2html}) has been updated by "<b>#{ticket.updated_by.f
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div>
|
<div>
|
||||||
Changes:<br>
|
i18n(Changes):<br>
|
||||||
' + changes + '
|
' + changes + '
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -389,7 +387,7 @@ Changes:<br>
|
||||||
def template_footer(_user, _ticket, _article)
|
def template_footer(_user, _ticket, _article)
|
||||||
'
|
'
|
||||||
<p>
|
<p>
|
||||||
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">i18n(View this directly here)</a>
|
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">i18n(View this in Zammad)</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<a href="#{config.http_type}://#{config.fqdn}/#profile/notifications">i18n(Manage your notifications settings)</a>
|
<a href="#{config.http_type}://#{config.fqdn}/#profile/notifications">i18n(Manage your notifications settings)</a>
|
||||||
|
|
|
@ -51,17 +51,7 @@ class Ticket < ApplicationModel
|
||||||
article_count: true,
|
article_count: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
search_index_support(
|
search_index_support
|
||||||
ignore_attributes: {
|
|
||||||
create_article_type_id: true,
|
|
||||||
create_article_sender_id: true,
|
|
||||||
article_count: true,
|
|
||||||
},
|
|
||||||
keep_attributes: {
|
|
||||||
customer_id: true,
|
|
||||||
organization_id: true,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
belongs_to :group
|
belongs_to :group
|
||||||
has_many :articles, class_name: 'Ticket::Article', after_add: :cache_update, after_remove: :cache_update
|
has_many :articles, class_name: 'Ticket::Article', after_add: :cache_update, after_remove: :cache_update
|
||||||
|
|
Loading…
Reference in a new issue