Maintenance: Fixed typos in inline comments.

This commit is contained in:
Denny Bresch 2019-07-31 10:23:48 +02:00 committed by Thorsten Eckel
parent 106bfd56da
commit bc38f1c1ae
107 changed files with 183 additions and 183 deletions

View file

@ -4,7 +4,7 @@ class App.Controller extends Spine.Controller
constructor: (params) -> constructor: (params) ->
# unbind old bindlings # unbind old bindings
if params && params.el && params.el.unbind if params && params.el && params.el.unbind
params.el.unbind() params.el.unbind()
@ -93,7 +93,7 @@ class App.Controller extends Spine.Controller
@off() @off()
@stopListening() @stopListening()
# add @title methode to set title # add @title method to set title
title: (name, translate = false) -> title: (name, translate = false) ->
# $('html head title').html(@Config.get(product_name) + ' - ' + App.i18n.translateInline(name)) # $('html head title').html(@Config.get(product_name) + ' - ' + App.i18n.translateInline(name))
title = name title = name
@ -115,18 +115,18 @@ class App.Controller extends Spine.Controller
App.Interval.reset() App.Interval.reset()
App.WebSocket.close(force: true) App.WebSocket.close(force: true)
# add @notify methode to create notification # add @notify method to create notification
notify: (data) -> notify: (data) ->
App.Event.trigger 'notify', data App.Event.trigger 'notify', data
# add @notifyDesktop methode to create desktop notification # add @notifyDesktop method to create desktop notification
notifyDesktop: (data) -> notifyDesktop: (data) ->
App.Event.trigger 'notifyDesktop', data App.Event.trigger 'notifyDesktop', data
# add @navupdate methode to update navigation # add @navupdate method to update navigation
navupdate: (url, force = false) -> navupdate: (url, force = false) ->
# ignore navupdate untill #clues are gone # ignore navupdate until #clues are gone
return if !force && window.location.hash is '#clues' return if !force && window.location.hash is '#clues'
App.Event.trigger 'navupdate', url App.Event.trigger 'navupdate', url

View file

@ -689,7 +689,7 @@ class App.ControllerForm extends App.Controller
# set forms to read only during communication with backend # set forms to read only during communication with backend
lookupForm.find('button, input, select, textarea').prop('readonly', true) lookupForm.find('button, input, select, textarea').prop('readonly', true)
# disable radio and checbkox buttons # disable radio and checkbox buttons
lookupForm.find('input[type=checkbox], input[type=radio]').prop('disabled', true) lookupForm.find('input[type=checkbox], input[type=radio]').prop('disabled', true)
# disable additionals submits # disable additionals submits
@ -714,7 +714,7 @@ class App.ControllerForm extends App.Controller
# enable fields again # enable fields again
lookupForm.find('button, input, select, textarea').prop('readonly', false) lookupForm.find('button, input, select, textarea').prop('readonly', false)
# enable radio and checbkox buttons # enable radio and checkbox buttons
lookupForm.find('input[type=checkbox], input[type=radio]').prop('disabled', false) lookupForm.find('input[type=checkbox], input[type=radio]').prop('disabled', false)
# enable submits again # enable submits again

View file

@ -740,7 +740,7 @@ class App.Sidebar extends App.Controller
dir: App.i18n.dir() dir: App.i18n.dir()
)) ))
# init sidebar badget # init sidebar badge
for item in itemsLocal for item in itemsLocal
el = localEl.find('.tabsSidebar-tab[data-tab="' + item.name + '"]') el = localEl.find('.tabsSidebar-tab[data-tab="' + item.name + '"]')
if item.badgeCallback if item.badgeCallback

View file

@ -167,7 +167,7 @@ class AppConfig extends App.ControllerModal
onSubmit: (e) => onSubmit: (e) =>
@formDisable(e) @formDisable(e)
# verify app credentals # verify app credentials
@ajax( @ajax(
id: 'facebook_app_verify' id: 'facebook_app_verify'
type: 'POST' type: 'POST'

View file

@ -168,7 +168,7 @@ class AppConfig extends App.ControllerModal
onSubmit: (e) => onSubmit: (e) =>
@formDisable(e) @formDisable(e)
# verify app credentals # verify app credentials
@ajax( @ajax(
id: 'twitter_app_verify' id: 'twitter_app_verify'
type: 'POST' type: 'POST'

View file

@ -351,7 +351,7 @@ class ConnectionWizard extends App.WizardModal
@showAlert('js-bind', 'Unable to retrive group information, please check your bind user permissions.') @showAlert('js-bind', 'Unable to retrive group information, please check your bind user permissions.')
return return
# update config if successfull # update config if successful
for key, value of params for key, value of params
@wizardConfig[key] = value @wizardConfig[key] = value

View file

@ -28,7 +28,7 @@ class Index extends App.ControllerSubContent
) )
# check if the browser supports webcam access # check if the browser supports webcam access
# doesnt render the camera button if not # doesn't render the camera button if not
hasGetUserMedia: -> hasGetUserMedia: ->
return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || return !!(navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia) navigator.mozGetUserMedia || navigator.msGetUserMedia)
@ -286,7 +286,7 @@ class Camera extends App.ControllerModal
@shootButton.removeClass 'is-disabled' @shootButton.removeClass 'is-disabled'
# in case the modal is closed before the # in case the modal is closed before the
# request was fullfilled # request was fulfilled
if @hidden if @hidden
@stopStream() @stopStream()
return return
@ -316,7 +316,7 @@ class Camera extends App.ControllerModal
onWebcamError: (error) => onWebcamError: (error) =>
# in case the modal is closed before the # in case the modal is closed before the
# request was fullfilled # request was fulfilled
if @hidden if @hidden
return return
@ -348,7 +348,7 @@ class Camera extends App.ControllerModal
updatePreview: => updatePreview: =>
# try catch fixes a Firefox error # try catch fixes a Firefox error
# were the drawImage wouldn't work # were the drawImage wouldn't work
# because the video didn't get inizialized # because the video didn't get initialized
# yet internally # yet internally
# http://stackoverflow.com/questions/18580844/firefox-drawimagevideo-fails-with-ns-error-not-available-component-is-not-av # http://stackoverflow.com/questions/18580844/firefox-drawimagevideo-fails-with-ns-error-not-available-component-is-not-av
try try

View file

@ -12,7 +12,7 @@ class App.SettingsArea extends App.Controller
render: => render: =>
# serach area settings # search area settings
settings = App.Setting.search( settings = App.Setting.search(
filter: filter:
area: @area area: @area

View file

@ -15,7 +15,7 @@ class App.SettingsForm extends App.Controller
render: => render: =>
# serach area settings # search area settings
settings = App.Setting.search( settings = App.Setting.search(
filter: filter:
area: @area area: @area

View file

@ -18,7 +18,7 @@ class App.UiElement.active extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
# return item # return item

View file

@ -21,7 +21,7 @@ class App.UiElement.autocompletion
$(local_attribute).val(item.id).trigger('change') $(local_attribute).val(item.id).trigger('change')
$(local_attribute + '_autocompletion_value_shown').val(item.value) $(local_attribute + '_autocompletion_value_shown').val(item.value)
# call calback # call callback
if @callback if @callback
params = App.ControllerForm.params(form) params = App.ControllerForm.params(form)
@callback(params) @callback(params)

View file

@ -41,7 +41,7 @@ class App.UiElement.basedate
@setNewTimeInitial(item, attribute) @setNewTimeInitial(item, attribute)
# observer changes / update needed to forece rerender to get correct today shown # observer changes / update needed to force rerender to get correct today shown
@bindEvents: (item, attribute) -> @bindEvents: (item, attribute) ->
item item
.find('input') .find('input')

View file

@ -16,7 +16,7 @@ class App.UiElement.boolean extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
item = $(App.view('generic/select')(attribute: attribute)) item = $(App.view('generic/select')(attribute: attribute))

View file

@ -14,7 +14,7 @@ class App.UiElement.checkbox extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions( attribute, params ) @sortOptions( attribute, params )
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions( attribute, params ) @selectedOptions( attribute, params )
# disable item of list # disable item of list

View file

@ -25,7 +25,7 @@ class App.UiElement.ical_feed extends App.UiElement.ApplicationUiElement
else else
item.find('.js-shadow').val( item.find('.js-list').val() ) item.find('.js-shadow').val( item.find('.js-list').val() )
# set inital state # set initial state
if icalFeeds[attribute.value] if icalFeeds[attribute.value]
updateCheckList() updateCheckList()
else else

View file

@ -172,7 +172,7 @@ class App.UiElement.postmaster_match
@buildValue(item, elementRow, key, groups, undefined, operator, attribute) @buildValue(item, elementRow, key, groups, undefined, operator, attribute)
) )
# build inital params # build initial params
if _.isEmpty(params[attribute.name]) if _.isEmpty(params[attribute.name])
item.find('.js-filterElement .js-attributeSelector select').trigger('change') item.find('.js-filterElement .js-attributeSelector select').trigger('change')
else else

View file

@ -154,7 +154,7 @@ class App.UiElement.postmaster_set
@buildValue(item, elementRow, groupAndAttribute, groups, undefined, undefined, attribute) @buildValue(item, elementRow, groupAndAttribute, groups, undefined, undefined, attribute)
) )
# build inital params # build initial params
if _.isEmpty(params[attribute.name]) if _.isEmpty(params[attribute.name])
element = @placeholder(item, attribute, params, groups) element = @placeholder(item, attribute, params, groups)
item.append(element) item.append(element)

View file

@ -16,7 +16,7 @@ class App.UiElement.radio extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
# disable item of list # disable item of list

View file

@ -20,7 +20,7 @@ class App.UiElement.searchable_select extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
# disable item of list # disable item of list

View file

@ -26,7 +26,7 @@ class App.UiElement.select extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
# disable item of list # disable item of list

View file

@ -22,7 +22,7 @@ class App.UiElement.select_search extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
# disable item of list # disable item of list

View file

@ -16,7 +16,7 @@ class App.UiElement.sla_times
solution_time_in_text: @toText(params.solution_time) solution_time_in_text: @toText(params.solution_time)
) ) ) )
# appliy hour picker # apply hour picker
item.find('.js-timeConvertFrom').timepicker( item.find('.js-timeConvertFrom').timepicker(
maxHours: 999 maxHours: 999
) )

View file

@ -16,7 +16,7 @@ class App.UiElement.ticket_perform_action
name: 'Notification' name: 'Notification'
model: 'Notification' model: 'Notification'
# megre config # merge config
elements = {} elements = {}
for groupKey, groupMeta of groups for groupKey, groupMeta of groups
if !groupMeta.model || !App[groupMeta.model] if !groupMeta.model || !App[groupMeta.model]
@ -99,7 +99,7 @@ class App.UiElement.ticket_perform_action
@buildOperator(item, elementRow, groupAndAttribute, elements, {}, attribute) @buildOperator(item, elementRow, groupAndAttribute, elements, {}, attribute)
) )
# build inital params # build initial params
if _.isEmpty(params[attribute.name]) if _.isEmpty(params[attribute.name])
for groupAndAttribute in defaults for groupAndAttribute in defaults

View file

@ -140,7 +140,7 @@ class App.UiElement.ticket_selector
@preview(item) @preview(item)
) )
# build inital params # build initial params
if !_.isEmpty(params[attribute.name]) if !_.isEmpty(params[attribute.name])
selectorExists = false selectorExists = false
for groupAndAttribute, meta of params[attribute.name] for groupAndAttribute, meta of params[attribute.name]

View file

@ -20,7 +20,7 @@ class App.UiElement.timezone extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
@selectedOptions(attribute, params) @selectedOptions(attribute, params)
attribute.tag = 'searchable_select' attribute.tag = 'searchable_select'

View file

@ -28,7 +28,7 @@ class App.UiElement.tree_select extends App.UiElement.ApplicationUiElement
# sort attribute.options # sort attribute.options
@sortOptions(attribute, params) @sortOptions(attribute, params)
# finde selected/checked item of list # find selected/checked item of list
if attribute.options if attribute.options
@optionsSelect(attribute.options, attribute.value) @optionsSelect(attribute.options, attribute.value)

View file

@ -20,7 +20,7 @@ class Index extends App.ControllerSubContent
render: => render: =>
# serach area settings # search area settings
settings = App.Setting.search( settings = App.Setting.search(
filter: filter:
area: 'API::Base' area: 'API::Base'

View file

@ -214,7 +214,7 @@ class App.CustomerChat extends App.Controller
preferences = @Session.get('preferences') preferences = @Session.get('preferences')
if App.Chat.first() && !preferences || !preferences.chat || !preferences.chat.active || _.isEmpty(preferences.chat.active) if App.Chat.first() && !preferences || !preferences.chat || !preferences.chat.active || _.isEmpty(preferences.chat.active)
# if we only have one chat, avtice it automatically # if we only have one chat, active it automatically
if App.Chat.count() < 2 if App.Chat.count() < 2
preferences.chat = {} preferences.chat = {}
preferences.chat.active = {} preferences.chat.active = {}

View file

@ -63,7 +63,7 @@ class App.KnowledgeBaseContentCanBePublishedForm extends App.ControllerForm
@form.find('[data-attribute-name="scheduled"]').remove() @form.find('[data-attribute-name="scheduled"]').remove()
@datePicker.datepicker('setStartDate', new Date()) @datePicker.datepicker('setStartDate', new Date())
# add scheduled tiemr widgets # add scheduled timer widgets
now = new Date() now = new Date()
for state in @states for state in @states

View file

@ -847,7 +847,7 @@ class TicketZoomRef extends App.ControllerContent
if highlights = localStorage['highlights'] if highlights = localStorage['highlights']
@highlighter.deserialize localStorage['highlights'] @highlighter.deserialize localStorage['highlights']
# the serialization creates one string for the entiery ticket # the serialization creates one string for the entire ticket
# containing the offsets and the highlight classes # containing the offsets and the highlight classes
# #
# we have to check how it works with having open several tickets it might break # we have to check how it works with having open several tickets it might break

View file

@ -82,7 +82,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
renderMenu: => renderMenu: =>
items = @getItems(navbar: @Config.get('NavBar')) items = @getItems(navbar: @Config.get('NavBar'))
# apply counter and switch info from persistant controllers (if exists) # apply counter and switch info from persistent controllers (if exists)
activeTab = {} activeTab = {}
itemsNew = [] itemsNew = []
for item in items for item in items
@ -111,7 +111,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
itemsNew.push item itemsNew.push item
items = itemsNew items = itemsNew
# get open tabs to repopen on rerender # get open tabs to reopen on rerender
openTab = {} openTab = {}
@$('.open').children('a').each( (i,d) -> @$('.open').children('a').each( (i,d) ->
href = $(d).attr('href') href = $(d).attr('href')
@ -151,7 +151,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
item.target = item.child[0].target item.target = item.child[0].target
delete item.child delete item.child
# get open tabs to repopen on rerender # get open tabs to reopen on rerender
openTab = {} openTab = {}
@$('.open').children('a').each( (i,d) -> @$('.open').children('a').each( (i,d) ->
href = $(d).attr('href') href = $(d).attr('href')
@ -366,7 +366,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
sub = @getOrder(dropdown[ item.parent ]) sub = @getOrder(dropdown[ item.parent ])
itemLevel1.child = sub itemLevel1.child = sub
# clean up, only show navbar items with existing childrens # clean up, only show navbar items with existing children
clean_list = [] clean_list = []
for item in level1 for item in level1
if !item.child || item.child && !_.isEmpty(item.child) if !item.child || item.child && !_.isEmpty(item.child)

View file

@ -12,7 +12,7 @@ class Index extends App.ControllerContent
@navigate '#' @navigate '#'
return return
# if we are logged in, no passwort reset is wanted, redirect to app # if we are logged in, no password reset is wanted, redirect to app
if @authenticateCheck() if @authenticateCheck()
@navigate '#' @navigate '#'
return return

View file

@ -34,7 +34,7 @@ class App.TicketZoom extends App.Controller
if cache if cache
@load(cache) @load(cache)
# check if ticket has beed updated every 30 min # check if ticket has been updated every 30 min
update = => update = =>
if !@initFetched if !@initFetched
@fetch() @fetch()
@ -74,7 +74,7 @@ class App.TicketZoom extends App.Controller
#console.log('debug no fetch, current ticket already there or requested') #console.log('debug no fetch, current ticket already there or requested')
return return
if new Date(data.updated_at).getTime() < new Date(@ticketUpdatedAtLastCall).getTime() if new Date(data.updated_at).getTime() < new Date(@ticketUpdatedAtLastCall).getTime()
#console.log('debug no fetch, current ticket already newser or requested') #console.log('debug no fetch, current ticket already newer or requested')
return return
@ticketUpdatedAtLastCall = data.updated_at @ticketUpdatedAtLastCall = data.updated_at
@ -200,7 +200,7 @@ class App.TicketZoom extends App.Controller
url: @url() url: @url()
id: @ticket_id id: @ticket_id
# set icon and tilte if defined # set icon and title if defined
if @taskIconClass if @taskIconClass
meta.iconClass = @taskIconClass meta.iconClass = @taskIconClass
if @taskHead if @taskHead
@ -773,7 +773,7 @@ class App.TicketZoom extends App.Controller
# for condition check # for condition check
ticket = App.Ticket.fullLocal(@ticket_id) ticket = App.Ticket.fullLocal(@ticket_id)
# reset article - should not be resubmited on next ticket update # reset article - should not be resubmitted on next ticket update
ticket.article = undefined ticket.article = undefined
# update ticket attributes # update ticket attributes
@ -903,7 +903,7 @@ class App.TicketZoom extends App.Controller
#App.SessionStorage.set(@key, data) #App.SessionStorage.set(@key, data)
@load(data, true, true) @load(data, true, true)
# reset article - should not be resubmited on next ticket update # reset article - should not be resubmitted on next ticket update
ticket.article = undefined ticket.article = undefined
# reset form after save # reset form after save

View file

@ -46,7 +46,7 @@ class EmailReply extends App.Controller
if !localAddress if !localAddress
foreignRecipients.push recipient foreignRecipients.push recipient
# check if reply all is neede # check if reply all is needed
if foreignRecipients.length > 1 if foreignRecipients.length > 1
actions.push { actions.push {
name: 'reply all' name: 'reply all'

View file

@ -278,7 +278,7 @@ class App.TicketZoomArticleNew extends App.Controller
if config && config.params if config && config.params
params = config.params(params.type, params, @) params = config.params(params.type, params, @)
# add initals? # add initials?
for articleType in @articleTypes for articleType in @articleTypes
if articleType.name is @type if articleType.name is @type
if _.contains(articleType.features, 'body:initials') if _.contains(articleType.features, 'body:initials')

View file

@ -133,7 +133,7 @@ class ArticleViewItem extends App.ObserverController
for attachment in article.attachments for attachment in article.attachments
attachment.url = "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?disposition=attachment" attachment.url = "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?disposition=attachment"
attachment.preview_url = "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?view=preview" attachment.preview_url = "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?view=preview"
if attachment && attachment.preferences && attachment.preferences['original-format'] is true if attachment && attachment.preferences && attachment.preferences['original-format'] is true
link = link =
url: "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?disposition=attachment" url: "#{App.Config.get('api_path')}/ticket_attachment/#{article.ticket_id}/#{article.id}/#{attachment.id}?disposition=attachment"
@ -159,7 +159,7 @@ class ArticleViewItem extends App.ObserverController
bodyHtml = App.Utils.text2html(article.body) bodyHtml = App.Utils.text2html(article.body)
article['html'] = App.Utils.signatureIdentifyByPlaintext(bodyHtml) article['html'] = App.Utils.signatureIdentifyByPlaintext(bodyHtml)
# if no signature detected or within frist 25 lines, check if signature got detected in backend # if no signature detected or within first 25 lines, check if signature got detected in backend
if article['html'] is bodyHtml || (article.preferences && article.preferences.signature_detection < 25) if article['html'] is bodyHtml || (article.preferences && article.preferences.signature_detection < 25)
signatureDetected = false signatureDetected = false
body = article.body body = article.body
@ -245,7 +245,7 @@ class ArticleViewItem extends App.ObserverController
bubbleContent.css('height', 'auto') bubbleContent.css('height', 'auto')
return return
# reset bubble heigth and "see more" opacity # reset bubble height and "see more" opacity
bubbleContent.css('height', '') bubbleContent.css('height', '')
bubbleOverflowContainer.css('opacity', '') bubbleOverflowContainer.css('opacity', '')
@ -256,19 +256,19 @@ class ArticleViewItem extends App.ObserverController
offsetTop = signatureMarker.position() offsetTop = signatureMarker.position()
# safari - workaround # safari - workaround
# in safari somethimes the marker is directly on top via .top and inspector but it isn't # in safari sometimes the marker is directly on top via .top and inspector but it isn't
# in this case use the next element # in this case use the next element
if offsetTop && offsetTop.top is 0 if offsetTop && offsetTop.top is 0
offsetTop = signatureMarker.next('div, p, br').position() offsetTop = signatureMarker.next('div, p, br').position()
# remember bubble content heigth # remember bubble content height
bubbleContentHeigth = bubbleContent.height() bubbleContentHeigth = bubbleContent.height()
# get marker heigth # get marker height
if offsetTop if offsetTop
markerHeight = offsetTop.top markerHeight = offsetTop.top
# if signature marker exists and heigth is within maxHeight # if signature marker exists and height is within maxHeight
if markerHeight && markerHeight < maxHeight if markerHeight && markerHeight < maxHeight
newHeigth = markerHeight + 30 newHeigth = markerHeight + 30
if newHeigth < minHeight if newHeigth < minHeight
@ -279,7 +279,7 @@ class ArticleViewItem extends App.ObserverController
bubbleContent.css('height', "#{newHeigth}px") bubbleContent.css('height', "#{newHeigth}px")
bubbleOverflowContainer.removeClass('hide') bubbleOverflowContainer.removeClass('hide')
# if heigth is higher then maxHeight # if height is higher then maxHeight
else if bubbleContentHeigth > maxHeight else if bubbleContentHeigth > maxHeight
bubbleContent.attr('data-height', bubbleContentHeigth + 30) bubbleContent.attr('data-height', bubbleContentHeigth + 30)
bubbleContent.attr('data-height-origin', maxHeight) bubbleContent.attr('data-height-origin', maxHeight)

View file

@ -91,7 +91,7 @@ class App.TicketZoomHighlighter extends App.Controller
articles.off('mousedown', @onMouseDown) articles.off('mousedown', @onMouseDown)
articles.on('mousedown', @onMouseDown) #future: touchend articles.on('mousedown', @onMouseDown) #future: touchend
# for testing purposes the highlights get stored in atrticle preferences # for testing purposes the highlights get stored in article preferences
loadHighlights: (ticket_article_id) -> loadHighlights: (ticket_article_id) ->
return if !@permissionCheck('ticket.agent') return if !@permissionCheck('ticket.agent')
article = App.TicketArticle.find(ticket_article_id) article = App.TicketArticle.find(ticket_article_id)
@ -103,7 +103,7 @@ class App.TicketZoomHighlighter extends App.Controller
@currentHighlights[ticket_article_id] = article.preferences.highlight @currentHighlights[ticket_article_id] = article.preferences.highlight
@highlighter.deserialize(article.preferences.highlight) @highlighter.deserialize(article.preferences.highlight)
# the serialization creates one string for the entiery ticket # the serialization creates one string for the entire ticket
# containing the offsets and the highlight classes # containing the offsets and the highlight classes
# #
# we have to check how it works with having open several tickets - it might break # we have to check how it works with having open several tickets - it might break

View file

@ -23,7 +23,7 @@ class App.TicketZoomTitle extends App.ObserverController
ticket = App.Ticket.find(@object_id) ticket = App.Ticket.find(@object_id)
ticket.title = title ticket.title = title
# reset article - should not be resubmited on next ticket update # reset article - should not be resubmitted on next ticket update
ticket.article = undefined ticket.article = undefined
ticket.save() ticket.save()

View file

@ -19,7 +19,7 @@ class App.OnlineNotificationWidget extends App.Controller
constructor: -> constructor: ->
super super
# at runtime if a online notifiction has changed # at runtime if an online notification has changed
@bind('OnlineNotification::changed', => @bind('OnlineNotification::changed', =>
@delay( @delay(
=> @fetch() => @fetch()
@ -54,7 +54,7 @@ class App.OnlineNotificationWidget extends App.Controller
@createContainer() @createContainer()
# rerender view, e. g. on langauge change # rerender view, e.g. on language change
@bind('ui:rerender', => @bind('ui:rerender', =>
@createContainer() @createContainer()
'online_notification' 'online_notification'

View file

@ -5,7 +5,7 @@ class Widget extends App.Controller
bind: -> bind: ->
# only do take over check after spool messages are finised # only do takeover check after spool messages are finished
App.Event.bind( App.Event.bind(
'spool:sent' 'spool:sent'
=> =>
@ -36,7 +36,7 @@ class Widget extends App.Controller
# check if error message is already shown # check if error message is already shown
if !@error if !@error
# only if new client id isnt own client id # only if new client id isn't own client id
if data.taskbar_id isnt App.TaskManager.TaskbarId() if data.taskbar_id isnt App.TaskManager.TaskbarId()
@error = new App.SessionMessage( @error = new App.SessionMessage(
head: 'Session' head: 'Session'

View file

@ -7,7 +7,7 @@ class Widget extends App.ControllerWidgetOnDemand
@bind 'app:ready', => @bind 'app:ready', =>
@render() @render()
# e. g. if language has chnaged # e.g. if language has changed
@bind 'ui:rerender', => @bind 'ui:rerender', =>
@render() @render()

View file

@ -18,7 +18,7 @@ class App.TicketStats extends App.Controller
else if @organization else if @organization
@subscribeIdOrganization = App.Organization.full(@organization.id, @load, false, true) @subscribeIdOrganization = App.Organization.full(@organization.id, @load, false, true)
# rerender view, e. g. on langauge change # rerender view, e.g. on language change
@bind 'ui:rerender', => @bind 'ui:rerender', =>
return if !@authenticateCheck() return if !@authenticateCheck()
@render() @render()

View file

@ -83,7 +83,7 @@ class App.Model extends Spine.Model
@validate: (data = {}) -> @validate: (data = {}) ->
# based on model attrbutes # based on model attributes
if App[ data['model'] ] && App[ data['model'] ].attributesGet if App[ data['model'] ] && App[ data['model'] ].attributesGet
attributes = App[ data['model'] ].attributesGet(data['screen']) attributes = App[ data['model'] ].attributesGet(data['screen'])
@ -338,7 +338,7 @@ set new attributes of model (remove already available attributes)
# localOrServer can be: # localOrServer can be:
# change -> has changed local # change -> has changed local
# destroy -> has beed removed local or remote # destroy -> has been removed local or remote
# refresh -> has been changed remote # refresh -> has been changed remote
params = params =
@ -456,7 +456,7 @@ set new attributes of model (remove already available attributes)
'change' 'change'
(items) => (items) =>
# check if result is array or singel item # check if result is array or single item
if !_.isArray(items) if !_.isArray(items)
items = [items] items = [items]
App.Log.debug('Model', "local change #{@className}", items) App.Log.debug('Model', "local change #{@className}", items)
@ -468,7 +468,7 @@ set new attributes of model (remove already available attributes)
'destroy' 'destroy'
(items) => (items) =>
# check if result is array or singel item # check if result is array or single item
if !_.isArray(items) if !_.isArray(items)
items = [items] items = [items]
App.Log.debug('Model', "local destroy #{@className}", items) App.Log.debug('Model', "local destroy #{@className}", items)
@ -482,7 +482,7 @@ set new attributes of model (remove already available attributes)
'refresh' 'refresh'
(items) => (items) =>
# check if result is array or singel item # check if result is array or single item
if !_.isArray(items) if !_.isArray(items)
items = [items] items = [items]
App.Log.debug('Model', "local refresh #{@className}", items) App.Log.debug('Model', "local refresh #{@className}", items)
@ -563,7 +563,7 @@ set new attributes of model (remove already available attributes)
App.Model.fetchFull( App.Model.fetchFull(
@callback @callback
clear: true clear: true
force: false # only do server call if no record exsits force: false # only do server call if no record exists
) )
@ -606,7 +606,7 @@ set new attributes of model (remove already available attributes)
if data.assets if data.assets
App.Collection.loadAssets(data.assets, targetModel: @className) App.Collection.loadAssets(data.assets, targetModel: @className)
# in case of no record_ids are there, no inital render is fired # if no record_ids are found, no initial render is fired
if data.record_ids && _.isEmpty(data.record_ids) if data.record_ids && _.isEmpty(data.record_ids)
App[@className].trigger('refresh', []) App[@className].trigger('refresh', [])

View file

@ -128,7 +128,7 @@ class App.User extends App.Model
@_fillUp: (data) -> @_fillUp: (data) ->
# set socal media links # set social media links
if data['accounts'] if data['accounts']
for account of data['accounts'] for account of data['accounts']
if account == 'twitter' if account == 'twitter'
@ -238,7 +238,7 @@ class App.User extends App.Model
if permission_key.substr(0, length) is requiredPermission.substr(0, length) if permission_key.substr(0, length) is requiredPermission.substr(0, length)
localAccess = true localAccess = true
# verify name.explicite permissions # verify name.explicit permissions
if !localAccess if !localAccess
for part in parts for part in parts
if partString isnt '' if partString isnt ''

View file

@ -13,7 +13,7 @@ module ApplicationController::HandlesDevices
def user_device_log(user, type) def user_device_log(user, type)
switched_from_user_id = ENV['SWITCHED_FROM_USER_ID'] || session[:switched_from_user_id] switched_from_user_id = ENV['SWITCHED_FROM_USER_ID'] || session[:switched_from_user_id]
return true if params[:controller] == 'init' # do no device logging on static inital page return true if params[:controller] == 'init' # do no device logging on static initial page
return true if switched_from_user_id return true if switched_from_user_id
return true if !user return true if !user
return true if !user.permissions?('user_preferences.device') return true if !user.permissions?('user_preferences.device')

View file

@ -104,7 +104,7 @@ class ChannelsEmailController < ApplicationController
# check account duplicate # check account duplicate
return if account_duplicate?({ setting: { inbound: params[:inbound] } }, channel_id) return if account_duplicate?({ setting: { inbound: params[:inbound] } }, channel_id)
# check delivery for 30 sek. # check delivery for 30 sec.
result = EmailHelper::Verify.email( result = EmailHelper::Verify.email(
outbound: params[:outbound].to_h, outbound: params[:outbound].to_h,
inbound: params[:inbound].to_h, inbound: params[:inbound].to_h,
@ -158,7 +158,7 @@ class ChannelsEmailController < ApplicationController
# remember address && set channel for email address # remember address && set channel for email address
address = EmailAddress.find_by(email: email) address = EmailAddress.find_by(email: email)
# if we are on initial setup, use already exisiting dummy email address # on initial setup, use placeholder email address
if Channel.count == 1 if Channel.count == 1
address = EmailAddress.first address = EmailAddress.first
end end

View file

@ -18,7 +18,7 @@ class Integration::CtiController < ApplicationController
return true return true
end end
# check if oubound call change the outbound caller_id # check if outbound call changes the outbound caller_id
if result[:action] == 'set_caller_id' if result[:action] == 'set_caller_id'
data = { data = {
action: 'dial', action: 'dial',

View file

@ -20,7 +20,7 @@ class Integration::PlacetelController < ApplicationController
return true return true
end end
# check if oubound call change the outbound caller_id # check if outbound call changes the outbound caller_id
if result[:action] == 'set_caller_id' if result[:action] == 'set_caller_id'
response_set_caller_id(result) response_set_caller_id(result)
return true return true

View file

@ -20,7 +20,7 @@ class Integration::SipgateController < ApplicationController
return true return true
end end
# check if oubound call change the outbound caller_id # check if outbound call changes the outbound caller_id
if result[:action] == 'set_caller_id' if result[:action] == 'set_caller_id'
response_set_caller_id(result) response_set_caller_id(result)
return true return true

View file

@ -241,7 +241,7 @@ class SessionsController < ApplicationController
# "switch" back to user # "switch" back to user
def switch_back_to_user def switch_back_to_user
# check if it's a swich back # check if it's a switch back
raise Exceptions::NotAuthorized if !session[:switched_from_user_id] raise Exceptions::NotAuthorized if !session[:switched_from_user_id]
user = User.lookup(id: session[:switched_from_user_id]) user = User.lookup(id: session[:switched_from_user_id])
@ -253,7 +253,7 @@ class SessionsController < ApplicationController
return false return false
end end
# rememeber current user # remember current user
current_session_user = current_user current_session_user = current_user
# remove switched_from_user_id # remove switched_from_user_id
@ -321,7 +321,7 @@ class SessionsController < ApplicationController
config[setting.name] = value config[setting.name] = value
end end
# remember if we can to swich back to user # remember if we can switch back to user
if session[:switched_from_user_id] if session[:switched_from_user_id]
config['switch_back_to_possible'] = true config['switch_back_to_possible'] = true
end end

View file

@ -115,7 +115,7 @@ class UsersController < ApplicationController
clean_params = User.param_cleanup(clean_params, true) clean_params = User.param_cleanup(clean_params, true)
# check if it's first user, the admin user # check if it's first user, the admin user
# inital admin account # initial admin account
count = User.all.count count = User.all.count
admin_account_exists = true admin_account_exists = true
if count <= 2 if count <= 2
@ -168,7 +168,7 @@ class UsersController < ApplicationController
user.group_ids = group_ids user.group_ids = group_ids
# remember source (in case show email verify banner) # remember source (in case show email verify banner)
# if not inital user creation # if not initial user creation
if admin_account_exists if admin_account_exists
user.source = 'signup' user.source = 'signup'
end end
@ -205,7 +205,7 @@ class UsersController < ApplicationController
end end
end end
# send inviteation if needed / only if session exists # send invitation if needed / only if session exists
if params[:invite].present? && current_user if params[:invite].present? && current_user
sleep 5 if ENV['REMOTE_URL'].present? sleep 5 if ENV['REMOTE_URL'].present?
token = Token.create(action: 'PasswordReset', user_id: user.id) token = Token.create(action: 'PasswordReset', user_id: user.id)
@ -321,7 +321,7 @@ class UsersController < ApplicationController
# @path [GET] /users/me # @path [GET] /users/me
# #
# @summary Returns the User record of current user. # @summary Returns the User record of current user.
# @notes The requestor need to have a valid authentication. # @notes The requester needs to have a valid authentication.
# #
# @parameter full [Bool] If set a Asset structure with all connected Assets gets returned. # @parameter full [Bool] If set a Asset structure with all connected Assets gets returned.
# #

View file

@ -61,7 +61,7 @@ add a new activity entry for an object
created_by_id: data[:created_by_id] created_by_id: data[:created_by_id]
).order(created_at: :desc).first ).order(created_at: :desc).first
# resturn if old entry is really fresh # return if old entry is really fresh
if result if result
activity_record_delay = 90.seconds activity_record_delay = 90.seconds
return result if result.created_at.to_i >= ( data[:created_at].to_i - activity_record_delay ) return result if result.created_at.to_i >= ( data[:created_at].to_i - activity_record_delay )

View file

@ -235,7 +235,7 @@ returns
end end
def filter_attributes(attributes) def filter_attributes(attributes)
# remove forbitten attributes # remove forbidden attributes
%w[password token tokens token_ids].each do |item| %w[password token tokens token_ids].each do |item|
attributes.delete(item) attributes.delete(item)
end end
@ -291,7 +291,7 @@ returns
=begin =begin
serve methode to ignore model attribute associations serve method to ignore model attribute associations
class Model < ApplicationModel class Model < ApplicationModel
include AssociationConcern include AssociationConcern

View file

@ -36,7 +36,7 @@ return possible lookup keys for model
returns returns
[:id, :name] # or fror users [:id, :login, :email] [:id, :name] # or, for users: [:id, :login, :email]
=end =end

View file

@ -4,7 +4,7 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
included do included do
# Builds a case insenstive WHERE ... OR ... SQL query. # Builds a case-insensitive WHERE ... OR ... SQL query.
# #
# @see .or_cis # @see .or_cis
# #
@ -19,10 +19,10 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
# methods defined here are going to extend the class, not the instance of it # methods defined here are going to extend the class, not the instance of it
class_methods do class_methods do
# Builds a case insenstive OR SQL grouping. This comes in handy for join queries. # Builds a case-insensitive OR SQL grouping. This comes in handy for join queries.
# For direct WHERE queries prefer .where_or_cis scope. # For direct WHERE queries prefer .where_or_cis scope.
# #
# @param [Array] attributes the attributes that should get queried case insensitive. Strings or Arel attributes # @param [Array] attributes the attributes that should get queried case-insensitive. Strings or Arel attributes
# @param [String] query the SQL query that should be used for each given attribute. # @param [String] query the SQL query that should be used for each given attribute.
# #
# @example # @example
@ -30,7 +30,7 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
# #
# @return [Arel::Nodes::Grouping] can be passed to ActiveRecord queries # @return [Arel::Nodes::Grouping] can be passed to ActiveRecord queries
def or_cis(attributes, query) def or_cis(attributes, query)
# use Arel to create an Array of case insenstive # use Arel to create an Array of case-insensitive
# LIKE queries based on the current DB adapter # LIKE queries based on the current DB adapter
cis_matches = attributes cis_matches = attributes
.map do |attribute| .map do |attribute|

View file

@ -126,7 +126,7 @@ add avatar by url
elsif data[:url].to_s.match?(%r{^https?://}) elsif data[:url].to_s.match?(%r{^https?://})
url = data[:url].to_s url = data[:url].to_s
# check if source ist already updated within last 2 minutes # check if source was updated within last 2 minutes
if avatar_already_exists&.source_url == url if avatar_already_exists&.source_url == url
return if avatar_already_exists.updated_at > 2.minutes.ago return if avatar_already_exists.updated_at > 2.minutes.ago
end end

View file

@ -15,7 +15,7 @@ class Calendar < ApplicationModel
=begin =begin
set inital default calendar set initial default calendar
calendar = Calendar.init_setup calendar = Calendar.init_setup
@ -30,7 +30,7 @@ returns calendar object
ip = nil ip = nil
end end
# prevent multible setups for same ip # prevent multiple setups for same ip
cache = Cache.get('Calendar.init_setup.done') cache = Cache.get('Calendar.init_setup.done')
return if cache && cache[:ip] == ip return if cache && cache[:ip] == ip

View file

@ -14,14 +14,14 @@ module Channel::Filter::AutoResponseCheck
mail[ 'x-zammad-article-preferences'.to_sym ]['send-auto-response'] = false mail[ 'x-zammad-article-preferences'.to_sym ]['send-auto-response'] = false
mail[ 'x-zammad-article-preferences'.to_sym ]['is-auto-response'] = true mail[ 'x-zammad-article-preferences'.to_sym ]['is-auto-response'] = true
# do not send an auto respondse if one of the following headers exists # do not send an auto response if one of the following headers exists
return if mail[ 'list-unsubscribe'.to_sym ] && mail[ 'list-unsubscribe'.to_sym ] =~ /.../ return if mail[ 'list-unsubscribe'.to_sym ] && mail[ 'list-unsubscribe'.to_sym ] =~ /.../
return if mail[ 'x-loop'.to_sym ] && mail[ 'x-loop'.to_sym ] =~ /(yes|true)/i return if mail[ 'x-loop'.to_sym ] && mail[ 'x-loop'.to_sym ] =~ /(yes|true)/i
return if mail[ 'precedence'.to_sym ] && mail[ 'precedence'.to_sym ] =~ /(bulk|list|junk)/i return if mail[ 'precedence'.to_sym ] && mail[ 'precedence'.to_sym ] =~ /(bulk|list|junk)/i
return if mail[ 'auto-submitted'.to_sym ] && mail[ 'auto-submitted'.to_sym ] =~ /auto-(generated|replied)/i return if mail[ 'auto-submitted'.to_sym ] && mail[ 'auto-submitted'.to_sym ] =~ /auto-(generated|replied)/i
return if mail[ 'x-auto-response-suppress'.to_sym ] && mail[ 'x-auto-response-suppress'.to_sym ] =~ /all/i return if mail[ 'x-auto-response-suppress'.to_sym ] && mail[ 'x-auto-response-suppress'.to_sym ] =~ /all/i
# do not send an auto respondse if sender is system it self # do not send an auto response if sender is system itself
message_id = mail[ 'message_id'.to_sym ] message_id = mail[ 'message_id'.to_sym ]
if message_id if message_id
fqdn = Setting.get('fqdn') fqdn = Setting.get('fqdn')

View file

@ -68,7 +68,7 @@ module Channel::Filter::FollowUpCheck
end end
end end
# get ticket# from references current email has same subject as inital article # get ticket# from references current email has same subject as initial article
if mail[:subject].present? if mail[:subject].present?
# get all references 'References' + 'In-Reply-To' # get all references 'References' + 'In-Reply-To'

View file

@ -116,7 +116,7 @@ module Channel::Filter::IdentifySender
return false if current_count == max_count return false if current_count == max_count
end end
rescue => e rescue => e
# parse not parseable fields by mail gem like # parse not parsable fields by mail gem like
# - Max Kohl | [example.com] <kohl@example.com> # - Max Kohl | [example.com] <kohl@example.com>
# - Max Kohl <max.kohl <max.kohl@example.com> # - Max Kohl <max.kohl <max.kohl@example.com>
Rails.logger.error 'ERROR: ' + e.inspect Rails.logger.error 'ERROR: ' + e.inspect

View file

@ -30,7 +30,7 @@ class Channel::Filter::MonitoringBase
# check if sender is monitoring # check if sender is monitoring
return if !Channel::Filter::Match::EmailRegex.match(value: mail[:from], match_rule: sender, check_mode: true) return if !Channel::Filter::Match::EmailRegex.match(value: mail[:from], match_rule: sender, check_mode: true)
# get mail attibutes like host and state # get mail attributes like host and state
result = {} result = {}
mail[:body].gsub(%r{(Service|Host|State|Address|Date/Time|Additional\sInfo|Info|Action|Description):(.+?)(\n|$)}i) do |_match| mail[:body].gsub(%r{(Service|Host|State|Address|Date/Time|Additional\sInfo|Info|Action|Description):(.+?)(\n|$)}i) do |_match|
@ -118,7 +118,7 @@ class Channel::Filter::MonitoringBase
end end
end end
# ignorte states # ignore states
if state_ignore_match.present? && result['state'].present? && result['state'].match(/#{state_ignore_match}/i) if state_ignore_match.present? && result['state'].present? && result['state'].match(/#{state_ignore_match}/i)
mail[ 'x-zammad-ignore'.to_sym ] = true mail[ 'x-zammad-ignore'.to_sym ] = true
return true return true

View file

@ -25,7 +25,7 @@ class Chat < ApplicationModel
avatar: url, avatar: url,
} }
# get queue postion if needed # get queue position if needed
session = Chat::Session.messages_by_session_id(session_id) session = Chat::Session.messages_by_session_id(session_id)
if session if session
return { return {
@ -174,7 +174,7 @@ broadcast new agent status to all agents
Chat.broadcast_agent_state_update Chat.broadcast_agent_state_update
optional you can ignore it for dedecated user optional you can ignore it for dedicated user
Chat.broadcast_agent_state_update(ignore_user_id) Chat.broadcast_agent_state_update(ignore_user_id)
@ -243,7 +243,7 @@ optional you can put the max oldest chat entries
=begin =begin
close chat sessions where participients are offline close chat sessions where participants are offline
Chat.cleanup_close Chat.cleanup_close

View file

@ -395,7 +395,7 @@ returns
=begin =begin
serve methode to ignore model based on id serve method to ignore model based on id
class Model < ApplicationModel class Model < ApplicationModel
include CanCsvImport include CanCsvImport
@ -410,7 +410,7 @@ end
=begin =begin
serve methode to ignore model attributes serve method to ignore model attributes
class Model < ApplicationModel class Model < ApplicationModel
include CanCsvImport include CanCsvImport
@ -433,7 +433,7 @@ end
=begin =begin
serve methode to define if delete option is possible or not serve method to define if delete option is possible or not
class Model < ApplicationModel class Model < ApplicationModel
include CanCsvImport include CanCsvImport

View file

@ -68,7 +68,7 @@ delete object activity stream, will be executed automatically
=begin =begin
serve methode to ignore model attributes in activity stream and/or limit activity stream permission serve method to ignore model attributes in activity stream and/or limit activity stream permission
class Model < ApplicationModel class Model < ApplicationModel
include HasActivityStreamLog include HasActivityStreamLog

View file

@ -232,7 +232,7 @@ returns
class_methods do class_methods do
=begin =begin
serve methode to ignore model attributes in historization serve method to ignore model attributes in historization
class Model < ApplicationModel class Model < ApplicationModel
include HasHistory include HasHistory
@ -247,7 +247,7 @@ end
=begin =begin
serve methode to ignore model attributes in historization serve method to ignore model attributes in historization
class Model < ApplicationModel class Model < ApplicationModel
include HasHistory include HasHistory

View file

@ -106,7 +106,7 @@ returns
=begin =begin
serve methode to ignore model attributes in search index serve method to ignore model attributes in search index
class Model < ApplicationModel class Model < ApplicationModel
include HasSearchIndexBackend include HasSearchIndexBackend

View file

@ -11,7 +11,7 @@ class Cti::Driver::Base
def process def process
# validate diections # validate directions
result = direction_check result = direction_check
return result if result.present? return result if result.present?
@ -36,10 +36,10 @@ class Cti::Driver::Base
log = Cti::Log.process(@params) log = Cti::Log.process(@params)
# push new call notifiation # push new call notification
push_incoming_call(log) push_incoming_call(log)
# open screen if call got answerd # open screen if call got answered
push_open_ticket_screen(log) push_open_ticket_screen(log)
result || {} result || {}
@ -47,7 +47,7 @@ class Cti::Driver::Base
def direction_check def direction_check
# check possible diections # check possible directions
if @params['direction'] != 'in' && @params['direction'] != 'out' if @params['direction'] != 'in' && @params['direction'] != 'out'
return { return {
action: 'invalid_direction', action: 'invalid_direction',

View file

@ -512,7 +512,7 @@ optional you can put the max oldest chat entries as argument
=begin =begin
returnes queues of user returns queues of user
['queue1', 'queue2'] = Cti::Log.queues_of_user(User.find(123), config) ['queue1', 'queue2'] = Cti::Log.queues_of_user(User.find(123), config)

View file

@ -76,7 +76,7 @@ check and if channel not exists reset configured channels for email addresses
end end
end end
# keep email email address is of inital group filled # keep email email address is of initial group filled
def update_email_address_id def update_email_address_id
not_configured = Group.where(email_address_id: nil).count not_configured = Group.where(email_address_id: nil).count
total = Group.count total = Group.count

View file

@ -100,7 +100,7 @@ job.run(true)
def executable?(start_at = Time.zone.now) def executable?(start_at = Time.zone.now)
return false if !active return false if !active
# only execute jobs, older then 1 min, to give admin posibility to change # only execute jobs older than 1 min to give admin time to make last-minute changes
return false if updated_at > Time.zone.now - 1.minute return false if updated_at > Time.zone.now - 1.minute
# check if job got stuck # check if job got stuck

View file

@ -67,7 +67,7 @@ class KnowledgeBase::Answer < ApplicationModel
def reordering_callback def reordering_callback
return if !category_id_changed? && !position_changed? return if !category_id_changed? && !position_changed?
# drop siblings cache to make sure orderign is always up to date # drop siblings cache to make sure ordering is always up to date
category.answers.each(&:cache_delete) category.answers.each(&:cache_delete)
end end
before_save :reordering_callback before_save :reordering_callback

View file

@ -124,7 +124,7 @@ class KnowledgeBase::Category < ApplicationModel
def reordering_callback def reordering_callback
return if !parent_id_changed? && !position_changed? return if !parent_id_changed? && !position_changed?
# drop siblings cache to make sure orderign is always up to date # drop siblings cache to make sure ordering is always up to date
sibling_categories.each(&:cache_delete) sibling_categories.each(&:cache_delete)
end end
before_save :reordering_callback before_save :reordering_callback

View file

@ -20,7 +20,7 @@ class Observer::Organization::RefObjectTouch < ActiveRecord::Observer
# return if we run import mode # return if we run import mode
return true if Setting.get('import_mode') return true if Setting.get('import_mode')
# featrue used for different propose, do not touch references # feature used for different purpose; do not touch references
return true if User.where(organization_id: record.id).count > 100 return true if User.where(organization_id: record.id).count > 100
# touch organizations tickets # touch organizations tickets

View file

@ -13,7 +13,7 @@ class Observer::Ticket::Article::CommunicateSms::BackgroundJob
ticket = Ticket.lookup(id: article.ticket_id) ticket = Ticket.lookup(id: article.ticket_id)
log_error(article, "Can't find article.preferences for Ticket::Article.find(#{article.id})") if !article.preferences log_error(article, "Can't find article.preferences for Ticket::Article.find(#{article.id})") if !article.preferences
# if sender is system, take artile channel # if sender is system, take article channel
if article.sender.name == 'System' if article.sender.name == 'System'
log_error(article, "Can't find article.preferences['sms_recipients'] for Ticket::Article.find(#{article.id})") if !article.preferences['sms_recipients'] log_error(article, "Can't find article.preferences['sms_recipients'] for Ticket::Article.find(#{article.id})") if !article.preferences['sms_recipients']
log_error(article, "Can't find article.preferences['channel_id'] for Ticket::Article.find(#{article.id})") if !article.preferences['channel_id'] log_error(article, "Can't find article.preferences['channel_id'] for Ticket::Article.find(#{article.id})") if !article.preferences['channel_id']

View file

@ -35,7 +35,7 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
# clean subject # clean subject
record.subject = ticket.subject_clean(record.subject) record.subject = ticket.subject_clean(record.subject)
# generate message id, force it in prodution, in test allow to set it for testing reasons # generate message id, force it in production, in test allow to set it for testing reasons
if !record.message_id || Rails.env.production? if !record.message_id || Rails.env.production?
fqdn = Setting.get('fqdn') fqdn = Setting.get('fqdn')
record.message_id = "<#{DateTime.current.to_s(:number)}.#{record.ticket_id}.#{rand(999_999_999_999)}@#{fqdn}>" record.message_id = "<#{DateTime.current.to_s(:number)}.#{record.ticket_id}.#{rand(999_999_999_999)}@#{fqdn}>"

View file

@ -55,7 +55,7 @@ class Observer::Ticket::ArticleChanges < ActiveRecord::Observer
true true
end end
# set frist response # set first response
def first_response_at_update(record) def first_response_at_update(record)
# return if we run import mode # return if we run import mode
@ -123,7 +123,7 @@ class Observer::Ticket::ArticleChanges < ActiveRecord::Observer
return true return true
end end
# if customer is sending agains, ignore update of last contact (usecase of update escalation) # if customer is sending again, ignore update of last contact (use case of update escalation)
return false if ticket.last_contact_customer_at && return false if ticket.last_contact_customer_at &&
ticket.last_contact_at && ticket.last_contact_at &&
ticket.last_contact_customer_at == ticket.last_contact_at ticket.last_contact_customer_at == ticket.last_contact_at

View file

@ -29,7 +29,7 @@ class Observer::Transaction < ActiveRecord::Observer
# reset buffer # reset buffer
EventBuffer.reset('transaction') EventBuffer.reset('transaction')
# get asyn backends # get async backends
sync_backends = [] sync_backends = []
Setting.where(area: 'Transaction::Backend::Sync').order(:name).each do |setting| Setting.where(area: 'Transaction::Backend::Sync').order(:name).each do |setting|
backend = Setting.get(setting.name) backend = Setting.get(setting.name)

View file

@ -177,7 +177,7 @@ mark online notification as seen by object
=begin =begin
check if all notifications are seed for dedecated object check if all notifications are seen for dedicated object
OnlineNotification.all_seen?('Ticket', 123) OnlineNotification.all_seen?('Ticket', 123)
@ -245,10 +245,10 @@ with dedicated times
OnlineNotification.where('created_at < ?', max_age).delete_all OnlineNotification.where('created_at < ?', max_age).delete_all
OnlineNotification.where('seen = ? AND updated_at < ?', true, max_own_seen).each do |notification| OnlineNotification.where('seen = ? AND updated_at < ?', true, max_own_seen).each do |notification|
# delete own "seen" notificatons after 1 hour # delete own "seen" notifications after 1 hour
next if notification.user_id == notification.updated_by_id && notification.updated_at > max_own_seen next if notification.user_id == notification.updated_by_id && notification.updated_at > max_own_seen
# delete notificatons which are set to "seen" by somebody else after 8 hour # delete notifications which are set to "seen" by somebody else after 8 hours
next if notification.user_id != notification.updated_by_id && notification.updated_at > max_auto_seen next if notification.user_id != notification.updated_by_id && notification.updated_at > max_auto_seen
notification.delete notification.delete

View file

@ -42,7 +42,7 @@ returns
if local_attributes['member_ids'].present? if local_attributes['member_ids'].present?
# featrue used for different propose, do limit references # feature used for different purpose; do limit references
if local_attributes['member_ids'].count > 100 if local_attributes['member_ids'].count > 100
local_attributes['member_ids'] = local_attributes['member_ids'].sort[0, 100] local_attributes['member_ids'] = local_attributes['member_ids'].sort[0, 100]
end end

View file

@ -44,7 +44,7 @@ class Overview < ApplicationModel
rearranged_prio += 1 rearranged_prio += 1
end end
# don't start rearrange logic for overviews that alredy get rearranged # don't start rearranging logic for overviews that have already been rearranged
self.class.without_callback(:update, :before, :rearrangement) do self.class.without_callback(:update, :before, :rearrangement) do
# fetch and update overview only if prio needs to change # fetch and update overview only if prio needs to change
overview = self.class.where( overview = self.class.where(

View file

@ -117,7 +117,7 @@ note: will not take down package migrations, use Package.unlink instead
execute migration down + unlink files execute migration down + unlink files
Package.unlink('/path/to/src/extention') Package.unlink('/path/to/src/extension')
=end =end
@ -153,7 +153,7 @@ execute migration down + unlink files
link files + execute migration up link files + execute migration up
Package.link('/path/to/src/extention') Package.link('/path/to/src/extension')
=end =end
@ -220,7 +220,7 @@ or
returns returns
package # record of new created packae package # record of newly created package
=end =end
@ -303,7 +303,7 @@ reinstall package
returns returns
package # record of new created packae package # record of newly created package
=end =end
@ -330,7 +330,7 @@ or
returns returns
package # record of new created packae package # record of newly created package
=end =end

View file

@ -6,7 +6,7 @@ class RecentView
=begin =begin
get all assets / related models for this recend view item get all assets / related models for this recent view item
recent_view = RecentView.find(123) recent_view = RecentView.find(123)
result = recent_view.assets(assets_if_exists) result = recent_view.assets(assets_if_exists)

View file

@ -36,7 +36,7 @@ class Scheduler < ApplicationModel
logger.error "Can't reconnect to database #{e.inspect}" logger.error "Can't reconnect to database #{e.inspect}"
end end
# read/load jobs and check if it is alredy started # read/load jobs and check if each has already been started
jobs = Scheduler.where('active = ?', true).order(prio: :asc) jobs = Scheduler.where('active = ?', true).order(prio: :asc)
jobs.each do |job| jobs.each do |job|
@ -56,7 +56,7 @@ class Scheduler < ApplicationModel
# Checks if a Scheduler Job should get started or not. # Checks if a Scheduler Job should get started or not.
# The decision is based on if there is a running thread or not. # The decision is based on if there is a running thread or not.
# Invalid threads get canceled and new threads can get started. # Invalid threads get cancelled and new threads can get started.
# #
# @param [Scheduler] job The job that should get checked for running threads. # @param [Scheduler] job The job that should get checked for running threads.
# #

View file

@ -297,7 +297,7 @@ returns
return if image.width <= width return if image.width <= width
# do not resize image if new height is smaller then 7px (images # do not resize image if new height is smaller then 7px (images
# with small height are usally usefull to resize) # with small height are usually useful to resize)
ratio = image.width / width ratio = image.width / width
return if image.height / ratio <= 6 return if image.height / ratio <= 6

View file

@ -68,7 +68,7 @@ file system check of store, check data and sha (in case fix it)
Store::File.verify Store::File.verify
read each file which should be in backend and verify agsinst sha hash read each file which should be in backend and verify against sha hash
in case of fixing sha hash use: in case of fixing sha hash use:

View file

@ -212,7 +212,7 @@ rename tag items
old_tag_item = Tag::Item.find(data[:id]) old_tag_item = Tag::Item.find(data[:id])
already_existing_tag = Tag::Item.lookup(name: new_tag_name) already_existing_tag = Tag::Item.lookup(name: new_tag_name)
# check if no remame is needed # check if no rename is needed
return true if new_tag_name == old_tag_item.name return true if new_tag_name == old_tag_item.name
# merge old with new tag if already existing # merge old with new tag if already existing

View file

@ -30,7 +30,7 @@ class Ticket < ApplicationModel
activity_stream_permission 'ticket.agent' activity_stream_permission 'ticket.agent'
activity_stream_attributes_ignored :organization_id, # organization_id will channge automatically on user update activity_stream_attributes_ignored :organization_id, # organization_id will change automatically on user update
:create_article_type_id, :create_article_type_id,
:create_article_sender_id, :create_article_sender_id,
:article_count, :article_count,
@ -1195,11 +1195,11 @@ result
get all articles of a ticket in correct order (overwrite active record default method) get all articles of a ticket in correct order (overwrite active record default method)
artilces = ticket.articles articles = ticket.articles
result result
[article1, articl2] [article1, article2]
=end =end
@ -1356,7 +1356,7 @@ result
end end
next if skip_user next if skip_user
# send notifications only to email adresses # send notifications only to email addresses
next if recipient_email.blank? next if recipient_email.blank?
next if recipient_email !~ /@/ next if recipient_email !~ /@/

View file

@ -52,7 +52,7 @@ returns
# return if we run import mode # return if we run import mode
return if Setting.get('import_mode') && !Setting.get('import_ignore_sla') return if Setting.get('import_mode') && !Setting.get('import_ignore_sla')
# set escalation off if current state is not escalation relativ (e. g. ticket is closed) # set escalation off if current state is not escalation relative (e.g. ticket is closed)
return if !state_id return if !state_id
state = Ticket::State.lookup(id: state_id) state = Ticket::State.lookup(id: state_id)
@ -60,7 +60,7 @@ returns
if state.ignore_escalation? if state.ignore_escalation?
escalation_disabled = true escalation_disabled = true
# early exit if nothing current state is not escalation relativ # early exit if nothing current state is not escalation relative
if !force if !force
return false if escalation_at.nil? return false if escalation_at.nil?

View file

@ -26,7 +26,7 @@ returns
=begin =begin
check if string contrains a valid ticket number check if string contains a valid ticket number
result = Ticket::Number.check('some string [Ticket#123456]') result = Ticket::Number.check('some string [Ticket#123456]')

View file

@ -157,7 +157,7 @@ returns
=begin =begin
list tickets by customer groupd in state categroie open and closed list tickets by customer group in state categories open and closed
result = Ticket::ScreenOptions.list_by_customer( result = Ticket::ScreenOptions.list_by_customer(
customer_id: 123, customer_id: 123,

View file

@ -26,7 +26,7 @@ returns
attributes[:tags] = tags attributes[:tags] = tags
end end
# list ignored file extentions # list ignored file extensions
attachments_ignore = Setting.get('es_attachment_ignore') || [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe' ] attachments_ignore = Setting.get('es_attachment_ignore') || [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe' ]
# max attachment size # max attachment size

View file

@ -17,7 +17,7 @@ returns
def subject_build(subject, prefix_mode = nil) def subject_build(subject, prefix_mode = nil)
# clena subject # clean subject
subject_parts = [subject_clean(subject)] subject_parts = [subject_clean(subject)]
# add hook # add hook

View file

@ -160,7 +160,7 @@ class Transaction::Notification
Rails.logger.debug { "sent ticket online notifiaction to agent (#{@item[:type]}/#{ticket.id}/#{user.email})" } Rails.logger.debug { "sent ticket online notifiaction to agent (#{@item[:type]}/#{ticket.id}/#{user.email})" }
end end
# ignore email channel notificaiton and empty emails # ignore email channel notification and empty emails
if !channels['email'] || !user.email || user.email == '' if !channels['email'] || !user.email || user.email == ''
add_recipient_list(ticket, user, used_channels, @item[:type]) add_recipient_list(ticket, user, used_channels, @item[:type])
next next
@ -270,7 +270,7 @@ class Transaction::Notification
changes[attribute_name] = value changes[attribute_name] = value
end end
# if changed item is an _id field/reference, do an lookup for the realy values # if changed item is an _id field/reference, look up the real values
value_id = [] value_id = []
value_str = [ value[0], value[1] ] value_str = [ value[0], value[1] ]
if key.to_s[-3, 3] == '_id' if key.to_s[-3, 3] == '_id'
@ -302,7 +302,7 @@ class Transaction::Notification
end end
end end
# check if we have an dedcated display name for it # check if we have a dedicated display name for it
display = attribute_name display = attribute_name
if object_manager_attribute && object_manager_attribute[:display] if object_manager_attribute && object_manager_attribute[:display]

View file

@ -237,7 +237,7 @@ class Transaction::Slack
changes[attribute_name] = value changes[attribute_name] = value
end end
# if changed item is an _id field/reference, do an lookup for the realy values # if changed item is an _id field/reference, look up the real values
value_id = [] value_id = []
value_str = [ value[0], value[1] ] value_str = [ value[0], value[1] ]
if key.to_s[-3, 3] == '_id' if key.to_s[-3, 3] == '_id'
@ -269,7 +269,7 @@ class Transaction::Slack
end end
end end
# check if we have an dedcated display name for it # check if we have a dedicated display name for it
display = attribute_name display = attribute_name
if object_manager_attribute && object_manager_attribute[:display] if object_manager_attribute && object_manager_attribute[:display]

View file

@ -333,7 +333,7 @@ returns
=begin =begin
authenticate user agains sso authenticate user again sso
result = User.sso(sso_params) result = User.sso(sso_params)
@ -725,7 +725,7 @@ returns
# to prevent any unexpected regressions.) # to prevent any unexpected regressions.)
User.find(user_id_of_duplicate_user) User.find(user_id_of_duplicate_user)
# merge missing attibutes # merge missing attributes
Models.merge('User', id, user_id_of_duplicate_user) Models.merge('User', id, user_id_of_duplicate_user)
true true
@ -759,7 +759,7 @@ returns
=begin =begin
update/sync default preferences of users in a dedecated permissions update/sync default preferences of users with dedicated permissions
result = User.update_default_preferences_by_permission('ticket.agent', force) result = User.update_default_preferences_by_permission('ticket.agent', force)
@ -796,7 +796,7 @@ returns
=begin =begin
update/sync default preferences of users in a dedecated role update/sync default preferences of users in a dedicated role
result = User.update_default_preferences_by_role('Agent', force) result = User.update_default_preferences_by_role('Agent', force)
@ -1254,7 +1254,7 @@ raise 'Minimum one user need to have admin permissions'
# don't permit empty password update for existing users # don't permit empty password update for existing users
return password_was if password.blank? return password_was if password.blank?
# don't re-hash an already hashed passsword # don't re-hash passwords
return password if PasswordHash.crypted?(password) return password if PasswordHash.crypted?(password)
# hash the plaintext password # hash the plaintext password

View file

@ -161,7 +161,7 @@ log user device action
user_device.ip = ip user_device.ip = ip
location_details = Service::GeoIp.location(ip) location_details = Service::GeoIp.location(ip)
# if we do not have any data from backend (e. g. geo ip ist out of service), ignore log # if we do not have any data from backend (e.g. geo ip is out of service), ignore log
if location_details && location_details['country_name'] if location_details && location_details['country_name']
user_device.location_details = location_details user_device.location_details = location_details

View file

@ -1,4 +1,4 @@
# load all core_ext extentions # load all core_ext extensions
Dir.glob( Rails.root.join('lib', 'core_ext', '**', '*') ).each do |file| Dir.glob( Rails.root.join('lib', 'core_ext', '**', '*') ).each do |file|
if File.file?(file) if File.file?(file)
require file require file

View file

@ -5,7 +5,7 @@ module ActiveRecord
module PostgreSQL module PostgreSQL
module SchemaStatements module SchemaStatements
# on postgres create lower indexes to support case insensetive wherer conditions # on postgres create lower indices to support case-insensitive where conditions
def add_index(table_name, column_name, options = {}) #:nodoc: def add_index(table_name, column_name, options = {}) #:nodoc:
index_name, index_type, index_columns, index_options, index_algorithm, index_using = add_index_options(table_name, column_name, options) index_name, index_type, index_columns, index_options, index_algorithm, index_using = add_index_options(table_name, column_name, options)

View file

@ -8,7 +8,7 @@ execute post database statements after import (e. g. reset primary key sequences
DbHelper.import_post DbHelper.import_post
or only for certan tables or only for certain tables
DbHelper.import_post(table_name) DbHelper.import_post(table_name)

View file

@ -40,7 +40,7 @@ module Enrichment
# Currently all target keys are prefixed with # Currently all target keys are prefixed with
# organization. # organization.
# which is not necessary since the target object # which is not necessary since the target object
# is allways an organization # is always an organization
@mapping.transform_values! { |value| value.sub('organization.', '') } @mapping.transform_values! { |value| value.sub('organization.', '') }
true true
end end

Some files were not shown because too many files have changed in this diff Show more