Merge branch 'master' of github.com:martini/zammad
This commit is contained in:
commit
1b17c31938
3 changed files with 14 additions and 2 deletions
|
@ -1,4 +1,13 @@
|
||||||
class App.Model extends Spine.Model
|
class App.Model extends Spine.Model
|
||||||
|
constructor: ->
|
||||||
|
super
|
||||||
|
|
||||||
|
# delete object from local storage on destroy
|
||||||
|
@bind( 'destroy', (e) ->
|
||||||
|
className = Object.getPrototypeOf(e).constructor.className
|
||||||
|
key = "collection::#{className}::#{e.id}"
|
||||||
|
App.Store.delete(key)
|
||||||
|
)
|
||||||
|
|
||||||
displayName: ->
|
displayName: ->
|
||||||
return @name if @name
|
return @name if @name
|
||||||
|
@ -69,3 +78,4 @@ class App.Model extends Spine.Model
|
||||||
model: @constructor,
|
model: @constructor,
|
||||||
params: @,
|
params: @,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.Sla extends Spine.Model
|
class App.Sla extends App.Model
|
||||||
@configure 'Sla', 'name', 'first_response_time', 'update_time', 'close_time', 'condition', 'data', 'active'
|
@configure 'Sla', 'name', 'first_response_time', 'update_time', 'close_time', 'condition', 'data', 'active'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/slas'
|
@url: 'api/slas'
|
||||||
|
|
|
@ -10,9 +10,11 @@ class ApplicationModel < ActiveRecord::Base
|
||||||
after_update :cache_delete
|
after_update :cache_delete
|
||||||
after_destroy :cache_delete
|
after_destroy :cache_delete
|
||||||
|
|
||||||
|
@@import_class_list = ['Ticket', 'Ticket::Article', 'History', 'Ticket::State', 'Ticket::Priority', 'Group', 'User' ]
|
||||||
|
|
||||||
# for import other objects, remove 'id'
|
# for import other objects, remove 'id'
|
||||||
def self.attributes_protected_by_default
|
def self.attributes_protected_by_default
|
||||||
if Setting.get('import_mode')
|
if Setting.get('import_mode') && @@import_class_list.include?( self.name.to_s )
|
||||||
['type']
|
['type']
|
||||||
else
|
else
|
||||||
['id','type']
|
['id','type']
|
||||||
|
|
Loading…
Reference in a new issue