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

View file

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

View file

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

View file

@ -168,7 +168,7 @@ class AppConfig extends App.ControllerModal
onSubmit: (e) =>
@formDisable(e)
# verify app credentals
# verify app credentials
@ajax(
id: 'twitter_app_verify'
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.')
return
# update config if successfull
# update config if successful
for key, value of params
@wizardConfig[key] = value

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -41,7 +41,7 @@ class App.UiElement.basedate
@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) ->
item
.find('input')

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -214,7 +214,7 @@ class App.CustomerChat extends App.Controller
preferences = @Session.get('preferences')
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
preferences.chat = {}
preferences.chat.active = {}

View file

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

View file

@ -847,7 +847,7 @@ class TicketZoomRef extends App.ControllerContent
if highlights = 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
#
# 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: =>
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 = {}
itemsNew = []
for item in items
@ -111,7 +111,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
itemsNew.push item
items = itemsNew
# get open tabs to repopen on rerender
# get open tabs to reopen on rerender
openTab = {}
@$('.open').children('a').each( (i,d) ->
href = $(d).attr('href')
@ -151,7 +151,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
item.target = item.child[0].target
delete item.child
# get open tabs to repopen on rerender
# get open tabs to reopen on rerender
openTab = {}
@$('.open').children('a').each( (i,d) ->
href = $(d).attr('href')
@ -366,7 +366,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
sub = @getOrder(dropdown[ item.parent ])
itemLevel1.child = sub
# clean up, only show navbar items with existing childrens
# clean up, only show navbar items with existing children
clean_list = []
for item in level1
if !item.child || item.child && !_.isEmpty(item.child)

View file

@ -12,7 +12,7 @@ class Index extends App.ControllerContent
@navigate '#'
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()
@navigate '#'
return

View file

@ -34,7 +34,7 @@ class App.TicketZoom extends App.Controller
if cache
@load(cache)
# check if ticket has beed updated every 30 min
# check if ticket has been updated every 30 min
update = =>
if !@initFetched
@fetch()
@ -74,7 +74,7 @@ class App.TicketZoom extends App.Controller
#console.log('debug no fetch, current ticket already there or requested')
return
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
@ticketUpdatedAtLastCall = data.updated_at
@ -200,7 +200,7 @@ class App.TicketZoom extends App.Controller
url: @url()
id: @ticket_id
# set icon and tilte if defined
# set icon and title if defined
if @taskIconClass
meta.iconClass = @taskIconClass
if @taskHead
@ -773,7 +773,7 @@ class App.TicketZoom extends App.Controller
# for condition check
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
# update ticket attributes
@ -903,7 +903,7 @@ class App.TicketZoom extends App.Controller
#App.SessionStorage.set(@key, data)
@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
# reset form after save

View file

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

View file

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

View file

@ -133,7 +133,7 @@ class ArticleViewItem extends App.ObserverController
for attachment in article.attachments
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"
if attachment && attachment.preferences && attachment.preferences['original-format'] is true
link =
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)
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)
signatureDetected = false
body = article.body
@ -245,7 +245,7 @@ class ArticleViewItem extends App.ObserverController
bubbleContent.css('height', 'auto')
return
# reset bubble heigth and "see more" opacity
# reset bubble height and "see more" opacity
bubbleContent.css('height', '')
bubbleOverflowContainer.css('opacity', '')
@ -256,19 +256,19 @@ class ArticleViewItem extends App.ObserverController
offsetTop = signatureMarker.position()
# 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
if offsetTop && offsetTop.top is 0
offsetTop = signatureMarker.next('div, p, br').position()
# remember bubble content heigth
# remember bubble content height
bubbleContentHeigth = bubbleContent.height()
# get marker heigth
# get marker height
if offsetTop
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
newHeigth = markerHeight + 30
if newHeigth < minHeight
@ -279,7 +279,7 @@ class ArticleViewItem extends App.ObserverController
bubbleContent.css('height', "#{newHeigth}px")
bubbleOverflowContainer.removeClass('hide')
# if heigth is higher then maxHeight
# if height is higher then maxHeight
else if bubbleContentHeigth > maxHeight
bubbleContent.attr('data-height', bubbleContentHeigth + 30)
bubbleContent.attr('data-height-origin', maxHeight)

View file

@ -91,7 +91,7 @@ class App.TicketZoomHighlighter extends App.Controller
articles.off('mousedown', @onMouseDown)
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) ->
return if !@permissionCheck('ticket.agent')
article = App.TicketArticle.find(ticket_article_id)
@ -103,7 +103,7 @@ class App.TicketZoomHighlighter extends App.Controller
@currentHighlights[ticket_article_id] = 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
#
# 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.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.save()

View file

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

View file

@ -5,7 +5,7 @@ class Widget extends App.Controller
bind: ->
# only do take over check after spool messages are finised
# only do takeover check after spool messages are finished
App.Event.bind(
'spool:sent'
=>
@ -36,7 +36,7 @@ class Widget extends App.Controller
# check if error message is already shown
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()
@error = new App.SessionMessage(
head: 'Session'

View file

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

View file

@ -18,7 +18,7 @@ class App.TicketStats extends App.Controller
else if @organization
@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', =>
return if !@authenticateCheck()
@render()

View file

@ -83,7 +83,7 @@ class App.Model extends Spine.Model
@validate: (data = {}) ->
# based on model attrbutes
# based on model attributes
if App[ data['model'] ] && App[ data['model'] ].attributesGet
attributes = App[ data['model'] ].attributesGet(data['screen'])
@ -338,7 +338,7 @@ set new attributes of model (remove already available attributes)
# localOrServer can be:
# change -> has changed local
# destroy -> has beed removed local or remote
# destroy -> has been removed local or remote
# refresh -> has been changed remote
params =
@ -456,7 +456,7 @@ set new attributes of model (remove already available attributes)
'change'
(items) =>
# check if result is array or singel item
# check if result is array or single item
if !_.isArray(items)
items = [items]
App.Log.debug('Model', "local change #{@className}", items)
@ -468,7 +468,7 @@ set new attributes of model (remove already available attributes)
'destroy'
(items) =>
# check if result is array or singel item
# check if result is array or single item
if !_.isArray(items)
items = [items]
App.Log.debug('Model', "local destroy #{@className}", items)
@ -482,7 +482,7 @@ set new attributes of model (remove already available attributes)
'refresh'
(items) =>
# check if result is array or singel item
# check if result is array or single item
if !_.isArray(items)
items = [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(
@callback
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
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)
App[@className].trigger('refresh', [])

View file

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

View file

@ -13,7 +13,7 @@ module ApplicationController::HandlesDevices
def user_device_log(user, type)
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 !user
return true if !user.permissions?('user_preferences.device')

View file

@ -104,7 +104,7 @@ class ChannelsEmailController < ApplicationController
# check account duplicate
return if account_duplicate?({ setting: { inbound: params[:inbound] } }, channel_id)
# check delivery for 30 sek.
# check delivery for 30 sec.
result = EmailHelper::Verify.email(
outbound: params[:outbound].to_h,
inbound: params[:inbound].to_h,
@ -158,7 +158,7 @@ class ChannelsEmailController < ApplicationController
# remember address && set channel for email address
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
address = EmailAddress.first
end

View file

@ -18,7 +18,7 @@ class Integration::CtiController < ApplicationController
return true
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'
data = {
action: 'dial',

View file

@ -20,7 +20,7 @@ class Integration::PlacetelController < ApplicationController
return true
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'
response_set_caller_id(result)
return true

View file

@ -20,7 +20,7 @@ class Integration::SipgateController < ApplicationController
return true
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'
response_set_caller_id(result)
return true

View file

@ -241,7 +241,7 @@ class SessionsController < ApplicationController
# "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]
user = User.lookup(id: session[:switched_from_user_id])
@ -253,7 +253,7 @@ class SessionsController < ApplicationController
return false
end
# rememeber current user
# remember current user
current_session_user = current_user
# remove switched_from_user_id
@ -321,7 +321,7 @@ class SessionsController < ApplicationController
config[setting.name] = value
end
# remember if we can to swich back to user
# remember if we can switch back to user
if session[:switched_from_user_id]
config['switch_back_to_possible'] = true
end

View file

@ -115,7 +115,7 @@ class UsersController < ApplicationController
clean_params = User.param_cleanup(clean_params, true)
# check if it's first user, the admin user
# inital admin account
# initial admin account
count = User.all.count
admin_account_exists = true
if count <= 2
@ -168,7 +168,7 @@ class UsersController < ApplicationController
user.group_ids = group_ids
# remember source (in case show email verify banner)
# if not inital user creation
# if not initial user creation
if admin_account_exists
user.source = 'signup'
end
@ -205,7 +205,7 @@ class UsersController < ApplicationController
end
end
# send inviteation if needed / only if session exists
# send invitation if needed / only if session exists
if params[:invite].present? && current_user
sleep 5 if ENV['REMOTE_URL'].present?
token = Token.create(action: 'PasswordReset', user_id: user.id)
@ -321,7 +321,7 @@ class UsersController < ApplicationController
# @path [GET] /users/me
#
# @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.
#

View file

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

View file

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

View file

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

View file

@ -4,7 +4,7 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
included do
# Builds a case insenstive WHERE ... OR ... SQL query.
# Builds a case-insensitive WHERE ... OR ... SQL query.
#
# @see .or_cis
#
@ -19,10 +19,10 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
# methods defined here are going to extend the class, not the instance of it
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.
#
# @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.
#
# @example
@ -30,7 +30,7 @@ module ApplicationModel::CanQueryCaseInsensitiveWhereOrSql
#
# @return [Arel::Nodes::Grouping] can be passed to ActiveRecord queries
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
cis_matches = attributes
.map do |attribute|

View file

@ -126,7 +126,7 @@ add avatar by url
elsif data[:url].to_s.match?(%r{^https?://})
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
return if avatar_already_exists.updated_at > 2.minutes.ago
end

View file

@ -15,7 +15,7 @@ class Calendar < ApplicationModel
=begin
set inital default calendar
set initial default calendar
calendar = Calendar.init_setup
@ -30,7 +30,7 @@ returns calendar object
ip = nil
end
# prevent multible setups for same ip
# prevent multiple setups for same ip
cache = Cache.get('Calendar.init_setup.done')
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 ]['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[ '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[ '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
# 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 ]
if message_id
fqdn = Setting.get('fqdn')

View file

@ -68,7 +68,7 @@ module Channel::Filter::FollowUpCheck
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?
# get all references 'References' + 'In-Reply-To'

View file

@ -116,7 +116,7 @@ module Channel::Filter::IdentifySender
return false if current_count == max_count
end
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 <max.kohl <max.kohl@example.com>
Rails.logger.error 'ERROR: ' + e.inspect

View file

@ -30,7 +30,7 @@ class Channel::Filter::MonitoringBase
# check if sender is monitoring
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 = {}
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
# ignorte states
# ignore states
if state_ignore_match.present? && result['state'].present? && result['state'].match(/#{state_ignore_match}/i)
mail[ 'x-zammad-ignore'.to_sym ] = true
return true

View file

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

View file

@ -395,7 +395,7 @@ returns
=begin
serve methode to ignore model based on id
serve method to ignore model based on id
class Model < ApplicationModel
include CanCsvImport
@ -410,7 +410,7 @@ end
=begin
serve methode to ignore model attributes
serve method to ignore model attributes
class Model < ApplicationModel
include CanCsvImport
@ -433,7 +433,7 @@ end
=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
include CanCsvImport

View file

@ -68,7 +68,7 @@ delete object activity stream, will be executed automatically
=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
include HasActivityStreamLog

View file

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

View file

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

View file

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

View file

@ -512,7 +512,7 @@ optional you can put the max oldest chat entries as argument
=begin
returnes queues of user
returns queues of user
['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
# keep email email address is of inital group filled
# keep email email address is of initial group filled
def update_email_address_id
not_configured = Group.where(email_address_id: nil).count
total = Group.count

View file

@ -100,7 +100,7 @@ job.run(true)
def executable?(start_at = Time.zone.now)
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
# check if job got stuck

View file

@ -67,7 +67,7 @@ class KnowledgeBase::Answer < ApplicationModel
def reordering_callback
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)
end
before_save :reordering_callback

View file

@ -124,7 +124,7 @@ class KnowledgeBase::Category < ApplicationModel
def reordering_callback
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)
end
before_save :reordering_callback

View file

@ -20,7 +20,7 @@ class Observer::Organization::RefObjectTouch < ActiveRecord::Observer
# return if we run 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
# touch organizations tickets

View file

@ -13,7 +13,7 @@ class Observer::Ticket::Article::CommunicateSms::BackgroundJob
ticket = Ticket.lookup(id: article.ticket_id)
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'
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']

View file

@ -35,7 +35,7 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
# clean 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?
fqdn = Setting.get('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
end
# set frist response
# set first response
def first_response_at_update(record)
# return if we run import mode
@ -123,7 +123,7 @@ class Observer::Ticket::ArticleChanges < ActiveRecord::Observer
return true
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 &&
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
EventBuffer.reset('transaction')
# get asyn backends
# get async backends
sync_backends = []
Setting.where(area: 'Transaction::Backend::Sync').order(:name).each do |setting|
backend = Setting.get(setting.name)

View file

@ -177,7 +177,7 @@ mark online notification as seen by object
=begin
check if all notifications are seed for dedecated object
check if all notifications are seen for dedicated object
OnlineNotification.all_seen?('Ticket', 123)
@ -245,10 +245,10 @@ with dedicated times
OnlineNotification.where('created_at < ?', max_age).delete_all
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
# 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
notification.delete

View file

@ -42,7 +42,7 @@ returns
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
local_attributes['member_ids'] = local_attributes['member_ids'].sort[0, 100]
end

View file

@ -44,7 +44,7 @@ class Overview < ApplicationModel
rearranged_prio += 1
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
# fetch and update overview only if prio needs to change
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
Package.unlink('/path/to/src/extention')
Package.unlink('/path/to/src/extension')
=end
@ -153,7 +153,7 @@ execute migration down + unlink files
link files + execute migration up
Package.link('/path/to/src/extention')
Package.link('/path/to/src/extension')
=end
@ -220,7 +220,7 @@ or
returns
package # record of new created packae
package # record of newly created package
=end
@ -303,7 +303,7 @@ reinstall package
returns
package # record of new created packae
package # record of newly created package
=end
@ -330,7 +330,7 @@ or
returns
package # record of new created packae
package # record of newly created package
=end

View file

@ -6,7 +6,7 @@ class RecentView
=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)
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}"
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.each do |job|
@ -56,7 +56,7 @@ class Scheduler < ApplicationModel
# Checks if a Scheduler Job should get started 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.
#

View file

@ -297,7 +297,7 @@ returns
return if image.width <= width
# 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
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
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:

View file

@ -212,7 +212,7 @@ rename tag items
old_tag_item = Tag::Item.find(data[:id])
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
# merge old with new tag if already existing

View file

@ -30,7 +30,7 @@ class Ticket < ApplicationModel
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_sender_id,
:article_count,
@ -1195,11 +1195,11 @@ result
get all articles of a ticket in correct order (overwrite active record default method)
artilces = ticket.articles
articles = ticket.articles
result
[article1, articl2]
[article1, article2]
=end
@ -1356,7 +1356,7 @@ result
end
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 !~ /@/

View file

@ -52,7 +52,7 @@ returns
# return if we run import mode
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
state = Ticket::State.lookup(id: state_id)
@ -60,7 +60,7 @@ returns
if state.ignore_escalation?
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
return false if escalation_at.nil?

View file

@ -26,7 +26,7 @@ returns
=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]')

View file

@ -157,7 +157,7 @@ returns
=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(
customer_id: 123,

View file

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

View file

@ -17,7 +17,7 @@ returns
def subject_build(subject, prefix_mode = nil)
# clena subject
# clean subject
subject_parts = [subject_clean(subject)]
# 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})" }
end
# ignore email channel notificaiton and empty emails
# ignore email channel notification and empty emails
if !channels['email'] || !user.email || user.email == ''
add_recipient_list(ticket, user, used_channels, @item[:type])
next
@ -270,7 +270,7 @@ class Transaction::Notification
changes[attribute_name] = value
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_str = [ value[0], value[1] ]
if key.to_s[-3, 3] == '_id'
@ -302,7 +302,7 @@ class Transaction::Notification
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
if object_manager_attribute && object_manager_attribute[:display]

View file

@ -237,7 +237,7 @@ class Transaction::Slack
changes[attribute_name] = value
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_str = [ value[0], value[1] ]
if key.to_s[-3, 3] == '_id'
@ -269,7 +269,7 @@ class Transaction::Slack
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
if object_manager_attribute && object_manager_attribute[:display]

View file

@ -333,7 +333,7 @@ returns
=begin
authenticate user agains sso
authenticate user again sso
result = User.sso(sso_params)
@ -725,7 +725,7 @@ returns
# to prevent any unexpected regressions.)
User.find(user_id_of_duplicate_user)
# merge missing attibutes
# merge missing attributes
Models.merge('User', id, user_id_of_duplicate_user)
true
@ -759,7 +759,7 @@ returns
=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)
@ -796,7 +796,7 @@ returns
=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)
@ -1254,7 +1254,7 @@ raise 'Minimum one user need to have admin permissions'
# don't permit empty password update for existing users
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)
# hash the plaintext password

View file

@ -161,7 +161,7 @@ log user device action
user_device.ip = 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']
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|
if File.file?(file)
require file

View file

@ -5,7 +5,7 @@ module ActiveRecord
module PostgreSQL
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:
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
or only for certan tables
or only for certain tables
DbHelper.import_post(table_name)

View file

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

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