Compare commits

...

103 commits

Author SHA1 Message Date
f
891987042f gems 2022-04-14 15:47:43 -03:00
f
089e4c36d3 Merge remote-tracking branch 'origin/stable-5.0' into antifascista-stable 2022-04-14 15:45:53 -03:00
Martin Gruner
348002559f Trigger a build. 2022-03-15 12:02:20 +01:00
Martin Gruner
658952a5cd Maintenance: Updated Rails. 2022-03-08 21:16:37 +01:00
Martin Gruner
fba5cdc838 Maintenance: Fix Clearbit integration test. 2022-03-01 10:14:30 +01:00
Rolf Schmidt
e5c56f1a1c Maintenance: Fix file permissions for db user helper. 2022-02-22 12:51:05 +00:00
Rolf Schmidt
d16b9b5ba4 Maintenance: Bump nokogiri from 1.13.1 to 1.13.3. 2022-02-22 11:13:10 +00:00
Rolf Schmidt
ca2885dce0 Fixes #3969 - Frequent “Lost connection to MySQL server during query” errors resulting in client-side Error 500. 2022-02-18 11:59:34 +00:00
Rolf Schmidt
4cb5a7776b Maintenance: Fix difference function to compare both ways and also make sure that the observer copies hashes to prevent references. 2022-02-17 08:35:55 +01:00
Rolf Schmidt
91dc61bbaa Fixes #3920 - Not translated text with forwarding e-mails. 2022-02-16 15:21:30 +00:00
Rolf Schmidt
30fd5d34da Fixes #3957 - S/MIME function buttons no longer working in tickets. 2022-02-16 16:20:14 +01:00
Martin Gruner
469d532b06 Maintenance: Bump rails from 6.0.4.4 to 6.0.4.6 and puma from 4.3.10 to 4.3.11. 2022-02-14 08:59:42 +01:00
f
62f319b589 Merge branch 'stable' of https://github.com/zammad/zammad into antifascista-stable 2022-02-11 14:06:58 -03:00
Rolf Schmidt
a33869cf29 Maintenance: Make sure relation options will be only read for select fields, so it has no impact for auto_completion fields. 2022-02-11 11:25:55 +00:00
Rolf Schmidt
3835bd3fdb Follow up 0b449839ea - Fixes #3956 - Migration of the MS365 account fails by upper and lower case differences in email address. 2022-02-10 16:36:22 +00:00
Rolf Schmidt
aa4ade336e Fixes #3956 - Migration of the MS365 account fails by upper and lower case... 2022-02-10 13:09:57 +01:00
Rolf Schmidt
bb025db806 Fixes #3955 - Elasticsearch-Rebuild does not index from new to old. 2022-02-09 09:46:36 +00:00
Rolf Schmidt
8fcb3fb52e Fixes #3921 - Can not chose SSL yes and port 143 when setting up mail account. 2022-02-08 09:39:05 +00:00
Rolf Schmidt
7703c3efc6 Fixes #3942 - New online notifications blocks data privacy user deletion. 2022-02-07 07:39:08 +00:00
Rolf Schmidt
f44a1a2bd4 Fixes #3940 - dead lock on user update in high load environment. 2022-02-01 10:07:31 +00:00
Marcel Herrguth
141dc0cad2 Backport: Fixes #3865, Fixes #3893 - Improve Backup & Restore script handling 2022-01-27 11:56:02 +01:00
Rolf Schmidt
879205d228 Fixes #3685 - Zammad UI should silently discard Cache / apply2file errors. 2022-01-25 14:25:53 +00:00
Martin Gruner
7ff7be804c Maintenance: Improve CI config to use any NodeJS available on the CentOS CI image. 2022-01-21 09:59:08 +01:00
Dominik Klein
bf5cb0a593 Maintenance: Fixed result data in the geo ip test. 2022-01-17 09:33:48 +01:00
uli-heller
7ef5032e27 Closes #3886 - Maintenance: Fix comment typos in html sanitizer. 2022-01-13 13:21:30 +00:00
Rolf Schmidt
f20e784501 Fixes #3909 - Wrong size for textareas in triggers and core workflow. 2022-01-13 13:21:22 +00:00
xaver
55765e29ed Closes #3886 - Add missing class for customer form element. 2022-01-13 13:21:08 +00:00
Marcel Herrguth
3413a2909c Fixes #3910 - Backport2Stable - Adjust placetel endpoints from EOL v1 to v2. 2022-01-10 14:48:20 +01:00
Rolf Schmidt
e3afa31402 Maintenance: Skip null values for the param check to prevent errors on the to string cast. 2022-01-06 16:41:41 +01:00
Dominik Klein
7adc0a12d0 Fixes #3879 - Freshdesk import ends up in Zammad interface without navigation. 2022-01-05 15:03:15 +01:00
Dominik Klein
82041f427b Fixes #3905 - Usage of freshdesk import without freshdesk admin permission leads to an unstable system/missing data 2022-01-05 12:50:34 +01:00
Rolf Schmidt
9006138d65 Follow up 6e90f4bfa2 - Fixes #3880 - Changing ticket status from "new" to any other status always results in uncommited status "closed". 2022-01-05 12:02:34 +01:00
Rolf Schmidt
3b18bb36dd Fixes #3880 - Changing ticket status from "new" to any other status always results in uncommited status "closed". 2022-01-05 10:20:39 +01:00
Rolf Schmidt
58807875e9 Performance: Only update specific calendars on destroy and not loop over all. 2022-01-04 14:09:04 +01:00
Rolf Schmidt
a7bc54db37 Maintenance: Make sure that the column schema is resetted on db reset to prevent old schema because of different branches or custom developments. 2022-01-03 14:45:51 +01:00
Martin Gruner
5163888b70 Maintenance: Disable copyright update for stable branch. 2022-01-01 14:37:49 +01:00
Martin Gruner
9ed29355f0 Maintenance: Switch from a hardcoded registry URL to $CI_REGISTRY. 2021-12-22 09:26:16 +01:00
Martin Gruner
152fb9aa05 Maintenance: Fixed user test. 2021-12-22 08:28:46 +01:00
Martin Gruner
f5c797719d Maintenance: Fix GIT push handling to not use shallow clones. 2021-12-17 14:27:10 +01:00
Dominik Klein
49a541b024 Fixes #3892 - /assets/fonts/ changed to /fonts/. 2021-12-17 08:59:16 +01:00
Marcel Herrguth
6ff08abc3a Backport2stable: Add Debian 11 support to packager.io processes 2021-12-16 16:03:38 +01:00
Martin Gruner
4397a7be50 Maintenance: Bump rails from 6.0.4.3 to 6.0.4.4
Bumps [rails](https://github.com/rails/rails) from 6.0.4.3 to 6.0.4.4.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.0.4.3...v6.0.4.4)
2021-12-16 09:26:47 +01:00
Martin Gruner
cf2d8dc820 Maintenance: Bump rails from 6.0.4.1 to 6.0.4.3
Bumps [rails](https://github.com/rails/rails) from 6.0.4.1 to 6.0.4.3.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.0.4.1...v6.0.4.3)
2021-12-15 07:42:17 +01:00
Romit Choudhary
23c5f43fca Fixes #2275 - Display name not used 2021-12-14 11:51:20 +05:30
Rolf Schmidt
827c18b471 Performance: Improve exists call function caching and make sure that expensive marschal object copies are reduced where it is not needed. 2021-12-13 12:12:10 +00:00
Rolf Schmidt
ecd29123c2 Fixes #3869 - Overview select fields are sorted by key. 2021-12-13 06:59:55 +00:00
Rolf Schmidt
b82b7693cf Fixes #3873 - Search is not triggered/updated if url of search is updated new search item or new search is triggered via global search. 2021-12-10 11:09:05 +00:00
Mantas
b757f8e2c5 Fixes #3870 - Text rendering does not work for e-mails (no new lines) 2021-12-09 22:36:07 +02:00
Rolf Schmidt
a8aea71a85 Fixes #3816 - Zammad 5 mail template double signature. 2021-12-07 14:38:20 +00:00
Rolf Schmidt
0e60fd5f62 Maintenance: Fix ExistsDbStrategy to not depend of the position of the db_strategy hash element. 2021-12-07 10:39:35 +00:00
Martin Gruner
140ebbb3ff Updated to 5.0.3 2021-12-07 08:00:08 +01:00
Martin Edenhofer
7d56a6a975 Maintenance: Improved notifications flow for replacement agents. 2021-12-06 07:19:38 +00:00
Rolf Schmidt
82b61e4811 Fixes #3877 - Missing ticket updates on high load in MariaDB/MySQL environments. 2021-12-03 10:14:36 +00:00
Martin Gruner
4905812382 Maintenance: Use zammad-api-client-php branch with tests compatible to Zammad 5.0. 2021-12-01 09:42:06 +01:00
Rolf Schmidt
9435da0a36 Fixes #3871 - Wrong SLA is used (alphabetical order is ignored). 2021-11-30 14:24:48 +00:00
Mantas Masalskis
106f55b4c2 Fixes #3872 - Agent with CREATE only permission acts "on behalf" ticket customer on shared organizations 2021-11-30 12:40:28 +00:00
Mantas Masalskis
04d1459121 Fixes #3616 - Provide meaningful modal if report profile tries to use dates out side the filtered date range 2021-11-30 13:40:08 +01:00
Bola Ahmed Buari
d2f24fc0fc Follow up - d61932d - Fixes #3594 - Allow position to determine an attributes position 2021-11-26 13:36:49 +00:00
Bola Ahmed Buari
913dcdd2ab Fixes 3594 - Allow position to determine an attributes position entirely. 2021-11-26 13:36:49 +00:00
Bola Ahmed Buari
f4116fb181 Fixes #294 - Possibility to specify the order of objects. 2021-11-26 13:36:49 +00:00
Rolf Schmidt
93c3eb1e20 Fixes #3622 - Display callback urls for third-party applications. 2021-11-26 14:03:22 +01:00
dantronik-markus
28eca31145 Fixes #3793 - Till label not assigned to corresponding input fields in calendar edit view. 2021-11-26 10:13:42 +00:00
Dominik Klein
8b16f483d6 Fixes #3846 - Simple quote characters (') not properly displayed. 2021-11-23 20:02:33 +01:00
Martin Gruner
10be8dabd3 Maintenance: Let SLA admin screen show the SLA description, not the Calendar description. 2021-11-22 08:03:07 +01:00
Rolf Schmidt
29d99f1d11 Fixes #3848 - Remove api user and password for sipgate integration. 2021-11-18 11:11:58 +00:00
Rolf Schmidt
c8a09f6ce8 Fixes #3844 - No signature on new ticket if email is default message type. 2021-11-17 16:27:41 +00:00
Mantas Masalskis
47b72864be Fixes #3855 - Forwarding no longer possible for email and web articles 2021-11-17 15:28:18 +01:00
Rolf Schmidt
1ba497d6ac Fixes #3851 - Default values of new group dialog is different in german vs. english. 2021-11-16 12:15:29 +00:00
Rolf Schmidt
49162d32d0 Fixes #3850 - If no date is set the UI show it's shown as NaN.NaN.NaN. 2021-11-16 11:13:24 +00:00
Rolf Schmidt
fb5ad0862b Fixes #3852 - Number of to show caller log entries is inconsistent setting wise. 2021-11-16 09:54:45 +00:00
Rolf Schmidt
59a7bce347 Maintenance: Fix log level for message bird errors. 2021-11-16 08:29:25 +00:00
Martin Gruner
4d90a7b240 Maintenance: Prevent back porting of new __() methods from develop. 2021-11-15 16:41:10 +01:00
Mantas Masalskis
a9b57e5719 Fixes #3825 - Reply all: Duplicate email on changing recipient and cc in a certain way 2021-11-12 15:37:34 +02:00
Dominik Klein
dc5ba3cbaa Maintenance: Simulate login instead of using the real login form all the time. 2021-11-12 10:25:57 +00:00
Rolf Schmidt
44703499e3 Fixes #3845 - Removing calendars via UI and API does not check for references. 2021-11-12 08:34:06 +00:00
Mantas Masalskis
8053f2fc72 Fixes #3824 - Email address not shown inside forwarded email 2021-11-11 16:33:15 +02:00
Mantas
86ded71621 Fixes #3837 - Wrong escalation update time in admin interface is shown 2021-11-09 18:22:54 +02:00
Rolf Schmidt
86671d5eaf Fixes #3841 - Zammad returns stack error when one tries to remove groups via API. 2021-11-09 11:17:46 +00:00
Rolf Schmidt
dd92280833 Fixes #3830 - Zammad ignores relative GitLab URLs. 2021-11-09 09:49:13 +00:00
Rolf Schmidt
cb3516e49d Fixes #3822 - If selected value is not part of the restriction of set_fixed_to it should recalculate it with the new value. 2021-11-08 09:22:06 +00:00
Rolf Schmidt
3e3e409562 Fixes #3821 - Add clear selection action or has changed condition. 2021-11-05 14:00:44 +00:00
Rolf Schmidt
ff6af07b9a Fixes #3835 - Invalid group and owner list for tickets created via customer profile. 2021-11-05 13:57:53 +01:00
Rolf Schmidt
1bd1cd669f Fixes #3831 - Ticket zoom will loose attachments on rerender. 2021-11-05 07:42:55 +00:00
Marcel Herrguth
c75141c2ff Fixes #3834 - Package installation creates database.yml as root and thus breaks the installation until next update 2021-11-04 15:28:58 +01:00
Rolf Schmidt
907062b7eb Follow up 189ccb21db - Fixes #3827 - Remove ticket create screen job because it is not needed anymore dropdown data will get updated on action by core workflow. 2021-11-03 16:14:59 +00:00
Dominik Klein
06af2b7936 Fixes #3733 - Simple quote characters (') not properly displayed.
(cherry picked from commit 2bd4ceeedf)
2021-11-03 14:32:27 +00:00
Dominik Klein
e54158c0a8 Fixes #3094, fixes #2334 - When quoting, no breakout from div container possible.
(cherry picked from commit e338309791)
2021-11-03 07:14:31 +00:00
Marcel Herrguth
49759f0be8 Fixes #3828 - Zammad database credentials are world-readable
Cherry pick of 71d6b9e413 to stable.
2021-11-02 15:14:43 +01:00
Mantas Masalskis
2c26e82354 Fixes #3140 - Update time SLAs escalates tickets with agent response. 2021-11-02 12:33:18 +01:00
Rolf Schmidt
3f1057c190 Fixes #3827 - Ticket create screen will loose attachments by time. 2021-10-29 13:46:49 +01:00
Martin Edenhofer
ad12ad4e01 Removed not needed headline. 2021-10-28 11:19:02 +02:00
Martin Edenhofer
ce5b9bd9de Updated to 5.0.2 2021-10-28 11:17:24 +02:00
Dominik Klein
59cfc7c69a Maintenance: Improved authentication helper for developers. 2021-10-28 09:42:11 +02:00
Rolf Schmidt
d9df6de234 Fixes #3815 - When looking for customers, it is no longer possible to change into organizations. 2021-10-26 11:58:22 +01:00
Rolf Schmidt
4f94b01d56 Fixes #3818 - Owner should get cleared if not listed in changed group. 2021-10-21 12:23:14 +01:00
Mantas Masalskis
678b5ada31 Fixes #3810 - Custom date and datetime attributes are filled with dates on creation of tickets/users after update from 4.1 to 5.x. 2021-10-20 18:55:26 +00:00
Rolf Schmidt
4ca7c25480 Fixes #3807 - Remove changes of 05a471f90d because they are not working as expected. 2021-10-20 16:57:39 +01:00
Rolf Schmidt
b9bb88e96d Fixes #3801 - Remote change of the group id does show it falsly as user change and not render the new value to the ticket. 2021-10-20 14:17:31 +00:00
Rolf Schmidt
274e5a849f Fixes #3727 - Adding private keys allows adding certificates. 2021-10-20 12:05:50 +01:00
Martin Edenhofer
cb48cd2dcd Fixes #3811 - Able to create custom fields for existing relation (e. g. ticket.state) - will lead to non bootable Zammad. 2021-10-19 09:39:03 +01:00
Mantas Masalskis
6de1053d4b Fixes #3800 - Sort order group_by broken (alphabetical) 2021-10-15 18:35:48 +00:00
Rolf Schmidt
0f4c6ddda3 Fixes #3809 - Ticket owner selection is not updated if owner selection should be empty. 2021-10-15 10:43:13 +00:00
Rolf Schmidt
485196b013 Fixes #2471 - Chat can't be closed after timeout. 2021-10-15 11:26:31 +02:00
257 changed files with 6083 additions and 3091 deletions

View file

@ -0,0 +1,20 @@
module.exports = class PreventUnderscoreBackport
rule:
name: 'prevent_underscore_backport'
level: 'error'
message: 'The method __(...) is not available in current stable'
description: '''
'''
constructor: ->
@callTokens = []
tokens: ['CALL_START']
lintToken: (token, tokenApi) ->
[type, tokenValue] = token
p = tokenApi.peek(-1)
if p[1] == '__'
return { }

3
.gitignore vendored
View file

@ -84,6 +84,9 @@
# Eclipse
/.project
# VSCode
/.vscode
# Byebug
/.byebug_history

View file

@ -1,5 +1,5 @@
default:
image: registry.znuny.com/docker/zammad-ci:2.7.4
image: $CI_REGISTRY/docker/zammad-ci:2.7.4
include:
- local: '/.gitlab/ci/base.yml'
@ -55,7 +55,7 @@ cache:
# Initialize application env
before_script:
- source /etc/profile.d/rvm.sh
- source /opt/rh/rh-nodejs12/enable
- source /opt/rh/rh-nodejs*/enable
- bundle install -j $(nproc) --path vendor
- bundle exec ruby .gitlab/configure_environment.rb
- source .gitlab/environment.env

View file

@ -74,35 +74,35 @@
# DB Docker
.docker_mysql: &docker_mysql
name: registry.znuny.com/docker/zammad-mysql:stable
name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
.docker_postgresql: &docker_postgresql
name: registry.znuny.com/docker/zammad-postgresql:stable
name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
.docker_elasticsearch: &docker_elasticsearch
name: registry.znuny.com/docker/zammad-elasticsearch:$ELASTICSEARCH_TAG
name: $CI_REGISTRY/docker/zammad-elasticsearch:$ELASTICSEARCH_TAG
alias: elasticsearch
.docker_selenium_chrome: &docker_selenium_chrome
name: registry.znuny.com/docker/zammad-selenium-chrome:stable
name: $CI_REGISTRY/docker/zammad-selenium-chrome:stable
alias: selenium-chrome
.docker_selenium_firefox: &docker_selenium_firefox
name: registry.znuny.com/docker/zammad-selenium-firefox:stable
name: $CI_REGISTRY/docker/zammad-selenium-firefox:stable
alias: selenium-firefox
.docker_imap: &docker_imap
name: registry.znuny.com/docker/zammad-imap:stable
name: $CI_REGISTRY/docker/zammad-imap:stable
alias: mail
.docker_redis: &docker_redis
name: registry.znuny.com/docker/zammad-redis:stable
name: $CI_REGISTRY/docker/zammad-redis:stable
alias: redis
.docker_memcached: &docker_memcached
name: registry.znuny.com/docker/zammad-memcached:stable
name: $CI_REGISTRY/docker/zammad-memcached:stable
alias: memcached
command: ["memcached", "-m", "256M"]

View file

@ -8,7 +8,7 @@ api_client_php:
script:
- RAILS_ENV=test bundle exec rake db:create
- RAILS_ENV=test bundle exec rake zammad:ci:test:start zammad:setup:auto_wizard
- git clone https://github.com/zammad/zammad-api-client-php.git
- git clone https://github.com/zammad/zammad-api-client-php.git -b zammad-ci-5.0 # Use state with tests compatible to 5.0
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php --install-dir=/usr/local/bin
- ln -s /usr/local/bin/composer.phar /usr/local/bin/composer

View file

@ -7,11 +7,11 @@ otrs_chrome:
IMPORT_OTRS_ENDPOINT: "http://zammad-ci-otrsimport-app/otrs/public.pl?Action=ZammadMigrator"
TZ: "Europe/Berlin" # Required for the zammad-ci-otrsimport-app containers
services:
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-selenium-chrome:stable
- name: $CI_REGISTRY/docker/zammad-selenium-chrome:stable
alias: selenium-chrome
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs6
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs6
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs6
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs6
alias: zammad-ci-otrsimport-app

View file

@ -11,7 +11,6 @@
- bundle exec rails test test/integration/elasticsearch_active_test.rb
- bundle exec rails test test/integration/elasticsearch_test.rb
- bundle exec rspec --tag searchindex --tag ~type:system --profile 10
- bundle exec rails test test/integration/report_test.rb
es:7:
<<: *template_integration_es

View file

@ -12,71 +12,71 @@
otrs:6:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs6
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs6
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs6
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs6
alias: zammad-ci-otrsimport-app
otrs:5:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs5
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs5
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs5
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs5
alias: zammad-ci-otrsimport-app
otrs:4:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs4
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs4
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs4
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs4
alias: zammad-ci-otrsimport-app
otrs:33:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs33
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs33
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs33
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs33
alias: zammad-ci-otrsimport-app
otrs:32:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs32
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs32
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs32
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs32
alias: zammad-ci-otrsimport-app
otrs:31:
<<: *template_integration_otrs
services:
- name: registry.znuny.com/docker/zammad-mysql:stable
- name: $CI_REGISTRY/docker/zammad-mysql:stable
alias: mysql
- name: registry.znuny.com/docker/zammad-postgresql:stable
- name: $CI_REGISTRY/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs31
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-db:otrs31
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs31
- name: $CI_REGISTRY/docker/zammad-ci-otrsimport-app:otrs31
alias: zammad-ci-otrsimport-app

View file

@ -6,7 +6,7 @@
- .rules_singletest
before_script:
- source /etc/profile.d/rvm.sh # ensure RVM is loaded
- source /opt/rh/rh-nodejs12/enable # ensure Node.js is available
- source /opt/rh/rh-nodejs*/enable # ensure Node.js is available
rubocop:
<<: *template_pre
@ -48,7 +48,7 @@ brakeman:
coffeelint:
<<: *template_pre
script:
- coffeelint app/
- coffeelint --rules ./.coffeelint/rules/* app/
bundle-audit:
<<: *template_pre
@ -62,8 +62,9 @@ github:
tags:
- deploy
before_script:
- "" # no RVM present in deploy ENV
- '' # no RVM present in deploy ENV
script:
- git fetch --unshallow
- script/build/sync_repo.sh git@github.com:zammad/zammad.git
global_refresh_envs:

View file

@ -56,6 +56,18 @@ targets:
- libimlib2
- libimlib2-dev
- shared-mime-info
debian-11:
dependencies:
- curl
- elasticsearch|elasticsearch-oss
- nginx|apache2
- postgresql|mariadb-server
- libimlib2
- shared-mime-info
build_dependencies:
- libimlib2
- libimlib2-dev
- shared-mime-info
ubuntu-16.04:
dependencies:
- curl

View file

@ -17,7 +17,7 @@ module RuboCop
PATTERN
def_node_matcher :has_reset?, <<-PATTERN
$(send _ {:describe :context :it} (_ ...) (hash ... (pair (sym :db_strategy) (sym {:reset :reset_all}))))
$(send _ {:describe :context :it :shared_examples} (_ ...) (hash <(pair (sym :db_strategy) (sym {:reset :reset_all})) ...> ))
PATTERN
MSG = 'Add a `db_strategy: :reset` to your context/decribe when you are creating object manager attributes!'.freeze

View file

@ -0,0 +1,17 @@
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
module RuboCop
module Cop
module Zammad
class PreventUnderscroreBackport < Base
MSG = <<~ERROR_MESSAGE.freeze
The method __(...) is not available in current stable.
ERROR_MESSAGE
def on_send(node)
add_offense(node) if node.method_name.eql? :__
end
end
end
end
end

View file

@ -13,7 +13,8 @@ module RuboCop
def on_new_investigation
if processed_source.raw_source.include? '# Copyright (C) 2012-'
update_copyright
# Disabled for stable branches.
# update_copyright
else
insert_copyright
end

View file

@ -10,3 +10,4 @@ require_relative 'cop/zammad/no_to_sym_on_string'
require_relative 'cop/zammad/prefer_negated_if_over_unless'
require_relative 'cop/zammad/update_copyright'
require_relative 'cop/zammad/forbid_rand'
require_relative 'cop/zammad/prevent_underscore_backport'

View file

@ -1,19 +1,86 @@
# Change Log
## [5.0.3](https://github.com/zammad/zammad/tree/5.0.3) (2021-12-07)
[Full Changelog](https://github.com/zammad/zammad/compare/5.0.2...5.0.3)
**Implemented enhancements:**
- Possibility to specify the order of objects [294](https://github.com/zammad/zammad/issues/294) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[object manager attribute](https://github.com/zammad/zammad/labels/object manager attribute)]
- Display callback urls for third-party applications [3622](https://github.com/zammad/zammad/issues/3622) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)]
- Add clear selection action or has changed condition [3821](https://github.com/zammad/zammad/issues/3821) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[specification required](https://github.com/zammad/zammad/labels/specification required)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
**Fixed bugs:**
- Missing ticket updates on high load in MariaDB/MySQL environments [3877](https://github.com/zammad/zammad/issues/3877) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Wrong SLA is used (alphabetical order is ignored) [3871](https://github.com/zammad/zammad/issues/3871) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Agent with CREATE only permission acts "on behalf" ticket customer on shared organizations [3872](https://github.com/zammad/zammad/issues/3872) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Provide meaningful modal if report profile tries to use dates out side the filtered date range [3616](https://github.com/zammad/zammad/issues/3616) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[reporting](https://github.com/zammad/zammad/labels/reporting)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Allow `position` to determine an attributes position entirely [3594](https://github.com/zammad/zammad/issues/3594) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[object manager attribute](https://github.com/zammad/zammad/labels/object manager attribute)] [[specification required](https://github.com/zammad/zammad/labels/specification required)]
- Till label not assigned to corresponding input fields in calendar edit view [3793](https://github.com/zammad/zammad/issues/3793) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[frontend / JS app](https://github.com/zammad/zammad/labels/frontend / JS app)]
- Simple quote characters (`'`) not properly displayed [3846](https://github.com/zammad/zammad/issues/3846) [[bug](https://github.com/zammad/zammad/labels/bug)] [[frontend / JS app](https://github.com/zammad/zammad/labels/frontend / JS app)]
- Remove api user and password for sipgate integration [3848](https://github.com/zammad/zammad/issues/3848) [[bug](https://github.com/zammad/zammad/labels/bug)] [[admin area](https://github.com/zammad/zammad/labels/admin area)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- No signature on new ticket if email is default message type [3844](https://github.com/zammad/zammad/issues/3844) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Forwarding no longer possible for email and web articles [3855](https://github.com/zammad/zammad/issues/3855) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Default values of new group dialog is different in german vs. english [3851](https://github.com/zammad/zammad/issues/3851) [[bug](https://github.com/zammad/zammad/labels/bug)]
- If no date is set the UI show it's shown as NaN.NaN.NaN. [3850](https://github.com/zammad/zammad/issues/3850) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Number of to show caller log entries is inconsistent setting wise [3852](https://github.com/zammad/zammad/issues/3852) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[admin area](https://github.com/zammad/zammad/labels/admin area)] [[integration](https://github.com/zammad/zammad/labels/integration)]
- Reply all: Duplicate email on changing recipient and cc in a certain way [3825](https://github.com/zammad/zammad/issues/3825) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Removing calendars via UI and API does not check for references [3845](https://github.com/zammad/zammad/issues/3845) [[bug](https://github.com/zammad/zammad/labels/bug)] [[blocker](https://github.com/zammad/zammad/labels/blocker)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[escalation logic](https://github.com/zammad/zammad/labels/escalation logic)]
- Email address not shown inside forwarded email [3824](https://github.com/zammad/zammad/issues/3824) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Wrong escalation update time in admin interface is shown [3837](https://github.com/zammad/zammad/issues/3837) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Zammad returns stack error when one tries to remove groups via API [3841](https://github.com/zammad/zammad/issues/3841) [[bug](https://github.com/zammad/zammad/labels/bug)] [[API](https://github.com/zammad/zammad/labels/API)]
- Zammad ignores relative GitLab URLs [3830](https://github.com/zammad/zammad/issues/3830) [[bug](https://github.com/zammad/zammad/labels/bug)] [[integration](https://github.com/zammad/zammad/labels/integration)]
- If selected value is not part of the restriction of set_fixed_to it should recalculate it with the new value [3822](https://github.com/zammad/zammad/issues/3822) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Invalid group and owner list for tickets created via customer profile [3835](https://github.com/zammad/zammad/issues/3835) [[bug](https://github.com/zammad/zammad/labels/bug)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
- Ticket zoom will loose attachments on rerender [3831](https://github.com/zammad/zammad/issues/3831) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Package installation creates database.yml as `root` and thus breaks the installation until next update [3834](https://github.com/zammad/zammad/issues/3834) [[bug](https://github.com/zammad/zammad/labels/bug)] [[blocker](https://github.com/zammad/zammad/labels/blocker)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Ticket create screen will loose attachments by time [3827](https://github.com/zammad/zammad/issues/3827) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Simple quote characters (`'`) not properly displayed [3733](https://github.com/zammad/zammad/issues/3733) [[bug](https://github.com/zammad/zammad/labels/bug)] [[frontend / JS app](https://github.com/zammad/zammad/labels/frontend / JS app)]
- When quoting, no breakout from div container possible [3094](https://github.com/zammad/zammad/issues/3094) [[bug](https://github.com/zammad/zammad/labels/bug)] [[ticket](https://github.com/zammad/zammad/labels/ticket)]
- Quoting not working cleanly, if content gets too much [2334](https://github.com/zammad/zammad/issues/2334) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[ticket](https://github.com/zammad/zammad/labels/ticket)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Zammad database credentials are world-readable [3828](https://github.com/zammad/zammad/issues/3828) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Update time SLAs escalates tickets with agent response [3140](https://github.com/zammad/zammad/issues/3140) [[bug](https://github.com/zammad/zammad/labels/bug)] [[escalation logic](https://github.com/zammad/zammad/labels/escalation logic)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
## [5.0.2](https://github.com/zammad/zammad/tree/5.0.2) (2021-10-28)
[Full Changelog](https://github.com/zammad/zammad/compare/5.0.1...5.0.2)
**Fixed bugs:**
- When looking for customers, it is no longer possible to change into organizations [3815](https://github.com/zammad/zammad/issues/3815) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)]
- Owner should get cleared if not listed in changed group [3818](https://github.com/zammad/zammad/issues/3818) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
- Custom date and datetime attributes are filled with dates on creation of tickets/users after update from 4.1 to 5.x [3810](https://github.com/zammad/zammad/issues/3810) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- ActionController::UnknownHttpMethod FRAGE [3807](https://github.com/zammad/zammad/issues/3807) [[bug](https://github.com/zammad/zammad/labels/bug)] [[blocker](https://github.com/zammad/zammad/labels/blocker)] [[overviews](https://github.com/zammad/zammad/labels/overviews)] [[macros](https://github.com/zammad/zammad/labels/macros)]
- Remote change of the group id does show it falsly as user change and not render the new value to the ticket [3801](https://github.com/zammad/zammad/issues/3801) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
- Adding private keys allows adding certificates [3727](https://github.com/zammad/zammad/issues/3727) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Able to create custom fields for existing relation (e. g. ticket.state) - will lead to non bootable Zammad [3811](https://github.com/zammad/zammad/issues/3811) [[bug](https://github.com/zammad/zammad/labels/bug)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Sort order group_by broken (alphabetical) [3800](https://github.com/zammad/zammad/issues/3800) [[bug](https://github.com/zammad/zammad/labels/bug)] [[overviews](https://github.com/zammad/zammad/labels/overviews)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Ticket owner selection is not updated if owner selection should be empty [3809](https://github.com/zammad/zammad/issues/3809) [[bug](https://github.com/zammad/zammad/labels/bug)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
- Chat can't be closed after timeout [2471](https://github.com/zammad/zammad/issues/2471) [[bug](https://github.com/zammad/zammad/labels/bug)] [[chat](https://github.com/zammad/zammad/labels/chat)]
- Support workflow mechanism to do pending reminder state hide pending time use case [3790](https://github.com/zammad/zammad/issues/3790) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- Cache.clear in postinstall.sh throws ugly errors on fresh installations [3808](https://github.com/zammad/zammad/issues/3808) [[bug](https://github.com/zammad/zammad/labels/bug)] [[blocker](https://github.com/zammad/zammad/labels/blocker)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Example payload in webhook view leads to 500 error [3794](https://github.com/zammad/zammad/issues/3794) [[bug](https://github.com/zammad/zammad/labels/bug)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- OS package upgrade fails (activity_stream_object_id) [3797](https://github.com/zammad/zammad/issues/3797) [[bug](https://github.com/zammad/zammad/labels/bug)]
## [5.0.1](https://github.com/zammad/zammad/tree/5.0.1) (2021-10-08)
[Full Changelog](https://github.com/zammad/zammad/compare/5.0.0...5.0.1)
**Fixed bugs:**
- Bug Report 4.1.x Overview Sort - Grouped by user [3737](https://github.com/zammad/zammad/issues/3737) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[overviews](https://github.com/zammad/zammad/labels/overviews)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[regression](https://github.com/zammad/zammad/labels/regression)]
- Article box opening on tickets with no changes [3789](https://github.com/zammad/zammad/issues/3789) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)]
- UploadCacheCleanupJob does not execute [3787](https://github.com/zammad/zammad/issues/3787) [[bug](https://github.com/zammad/zammad/labels/bug)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- lib/fill_db.rb fails to work in production environments [3788](https://github.com/zammad/zammad/issues/3788) [[bug](https://github.com/zammad/zammad/labels/bug)]
## [5.0.0](https://github.com/zammad/zammad/tree/5.0.0) (2021-10-05)
[Full Changelog](https://github.com/zammad/zammad/compare/4.1.0...5.0.0)
**Implemented enhancements:**
- Core Workflow: Add organization condition attributes for object User [3779](https://github.com/zammad/zammad/issues/3779) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)]
- No script content (e. g. javascript) in emails [3365](https://github.com/zammad/zammad/issues/3365) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[mail processing](https://github.com/zammad/zammad/labels/mail processing)]
- Read-only custom objects [2102](https://github.com/zammad/zammad/issues/2102) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[prioritised by payment](https://github.com/zammad/zammad/labels/prioritised by payment)] [[object manager attribute](https://github.com/zammad/zammad/labels/object manager attribute)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]
@ -44,6 +111,7 @@
- Display minutes for session timeouts instead of seconds [3575](https://github.com/zammad/zammad/issues/3575) [[enhancement](https://github.com/zammad/zammad/labels/enhancement)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[admin area](https://github.com/zammad/zammad/labels/admin area)]
**Fixed bugs:**
- Inconstant alignment in the listing of attachments/submit button in new article area [3773](https://github.com/zammad/zammad/issues/3773) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Improve contrasts in answer search for articles [3783](https://github.com/zammad/zammad/issues/3783) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX/UI)] [[knowledge base](https://github.com/zammad/zammad/labels/knowledge base)]
- escaped 'Set fixed' workflows don't refresh set values on active ticket sessions [3757](https://github.com/zammad/zammad/issues/3757) [[bug](https://github.com/zammad/zammad/labels/bug)] [[core workflows](https://github.com/zammad/zammad/labels/core workflows)]

View file

@ -3,7 +3,7 @@
source 'https://gems.sutty.nl'
# core - base
ruby '2.7.4'
ruby '2.7.5'
gem 'rails', '~> 6.0'
# core - rails additions

View file

@ -21,50 +21,50 @@ GEM
specs:
aasm (5.2.0)
concurrent-ruby (~> 1.0)
actioncable (6.0.4.1)
actionpack (= 6.0.4.1)
actioncable (6.0.4.7)
actionpack (= 6.0.4.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.4.1)
actionpack (= 6.0.4.1)
activejob (= 6.0.4.1)
activerecord (= 6.0.4.1)
activestorage (= 6.0.4.1)
activesupport (= 6.0.4.1)
actionmailbox (6.0.4.7)
actionpack (= 6.0.4.7)
activejob (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
mail (>= 2.7.1)
actionmailer (6.0.4.1)
actionpack (= 6.0.4.1)
actionview (= 6.0.4.1)
activejob (= 6.0.4.1)
actionmailer (6.0.4.7)
actionpack (= 6.0.4.7)
actionview (= 6.0.4.7)
activejob (= 6.0.4.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.4.1)
actionview (= 6.0.4.1)
activesupport (= 6.0.4.1)
actionpack (6.0.4.7)
actionview (= 6.0.4.7)
activesupport (= 6.0.4.7)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.4.1)
actionpack (= 6.0.4.1)
activerecord (= 6.0.4.1)
activestorage (= 6.0.4.1)
activesupport (= 6.0.4.1)
actiontext (6.0.4.7)
actionpack (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
nokogiri (>= 1.8.5)
actionview (6.0.4.1)
activesupport (= 6.0.4.1)
actionview (6.0.4.7)
activesupport (= 6.0.4.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.4.1)
activesupport (= 6.0.4.1)
activejob (6.0.4.7)
activesupport (= 6.0.4.7)
globalid (>= 0.3.6)
activemodel (6.0.4.1)
activesupport (= 6.0.4.1)
activerecord (6.0.4.1)
activemodel (= 6.0.4.1)
activesupport (= 6.0.4.1)
activemodel (6.0.4.7)
activesupport (= 6.0.4.7)
activerecord (6.0.4.7)
activemodel (= 6.0.4.7)
activesupport (= 6.0.4.7)
activerecord-import (1.2.0)
activerecord (>= 3.2)
activerecord-nulldb-adapter (0.7.0)
@ -75,12 +75,12 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.0.4.1)
actionpack (= 6.0.4.1)
activejob (= 6.0.4.1)
activerecord (= 6.0.4.1)
activestorage (6.0.4.7)
actionpack (= 6.0.4.7)
activejob (= 6.0.4.7)
activerecord (= 6.0.4.7)
marcel (~> 1.0.0)
activesupport (6.0.4.1)
activesupport (6.0.4.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@ -250,7 +250,7 @@ GEM
rainbow (>= 2.2.1)
rake (>= 10.0)
gli (2.20.1)
globalid (0.5.2)
globalid (1.0.0)
activesupport (>= 5.0)
gmail_xoauth (0.4.2)
oauth (>= 0.3.6)
@ -291,7 +291,7 @@ GEM
http_parser.rb (0.6.0)
http_parser.rb (0.6.0-x86_64-linux-musl)
httpclient (2.8.3)
i18n (1.8.10)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
icalendar (2.7.1)
ice_cube (~> 0.16)
@ -319,11 +319,11 @@ GEM
logging (2.3.0)
little-plugger (~> 1.1)
multi_json (~> 1.14)
loofah (2.12.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
marcel (1.0.1)
marcel (1.0.2)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
messagebird-rest (3.0.0)
@ -331,11 +331,11 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225)
mini_mime (1.1.1)
mini_portile2 (2.6.1)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
mini_racer (0.2.9)
libv8 (>= 6.9.411)
minitest (5.14.4)
minitest (5.15.0)
msgpack (1.4.2)
msgpack (1.4.2-x86_64-linux-musl)
multi_json (1.15.0)
@ -350,11 +350,11 @@ GEM
netrc (0.11.0)
nio4r (2.5.8)
nio4r (2.5.8-x86_64-linux-musl)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.12.5-x86_64-linux-musl)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.3-x86_64-linux-musl)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nori (2.6.0)
notiffany (0.1.3)
@ -443,7 +443,7 @@ GEM
binding_of_caller (~> 1.0)
pry (~> 0.13)
public_suffix (4.0.6)
puma (4.3.10)
puma (4.3.11)
nio4r (~> 2.0)
puma (4.3.8-x86_64-linux-musl)
nio4r (~> 2.0)
@ -451,27 +451,27 @@ GEM
activesupport (>= 3.0.0)
pundit-matchers (1.7.0)
rspec-rails (>= 3.0.0)
racc (1.5.2)
racc (1.5.2-x86_64-linux-musl)
racc (1.6.0)
racc (1.6.0-x86_64-linux-musl)
rack (2.2.3)
rack-livereload (0.3.17)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.4.1)
actioncable (= 6.0.4.1)
actionmailbox (= 6.0.4.1)
actionmailer (= 6.0.4.1)
actionpack (= 6.0.4.1)
actiontext (= 6.0.4.1)
actionview (= 6.0.4.1)
activejob (= 6.0.4.1)
activemodel (= 6.0.4.1)
activerecord (= 6.0.4.1)
activestorage (= 6.0.4.1)
activesupport (= 6.0.4.1)
rails (6.0.4.7)
actioncable (= 6.0.4.7)
actionmailbox (= 6.0.4.7)
actionmailer (= 6.0.4.7)
actionpack (= 6.0.4.7)
actiontext (= 6.0.4.7)
actionview (= 6.0.4.7)
activejob (= 6.0.4.7)
activemodel (= 6.0.4.7)
activerecord (= 6.0.4.7)
activestorage (= 6.0.4.7)
activesupport (= 6.0.4.7)
bundler (>= 1.3.0)
railties (= 6.0.4.1)
railties (= 6.0.4.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@ -480,11 +480,11 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.1)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (6.0.4.1)
actionpack (= 6.0.4.1)
activesupport (= 6.0.4.1)
railties (6.0.4.7)
actionpack (= 6.0.4.7)
activesupport (= 6.0.4.7)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
@ -597,9 +597,9 @@ GEM
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sync (0.5.0)
tcr (0.2.2)
@ -610,7 +610,7 @@ GEM
tins (~> 1.0)
test-unit (3.4.7)
power_assert
thor (1.1.0)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
timers (4.3.3)
@ -666,7 +666,7 @@ GEM
writeexcel (1.0.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.2)
zeitwerk (2.5.4)
zendesk_api (1.33.0)
faraday (>= 0.9.0, < 2.0.0)
hashie (>= 3.5.2, < 5.0.0)
@ -792,7 +792,7 @@ DEPENDENCIES
zendesk_api
RUBY VERSION
ruby 2.7.4p191
ruby 2.7.5p203
BUNDLED WITH
2.2.20

View file

@ -300,9 +300,10 @@ class App.Controller extends Spine.Controller
frontendTimeUpdateItem: (item, currentVal) =>
timestamp = item.attr('datetime')
time = @humanTime(timestamp, item.hasClass('escalation'))
return if timestamp is 'null'
# only do dom updates on changes
time = @humanTime(timestamp, item.hasClass('escalation'))
return if time is currentVal
newTitle = App.i18n.translateTimestamp(timestamp)

View file

@ -418,11 +418,11 @@ class App.ControllerForm extends App.Controller
if !@constructor.fieldIsMandatory(field_by_name)
field_by_name.attr('required', true)
field_by_name.parents('.form-group').find('label span').html('*')
field_by_name.closest('.form-group').find('label span').html('*')
field_by_name.closest('.form-group').addClass('is-required')
if !@constructor.fieldIsMandatory(field_by_data)
field_by_data.attr('required', true)
field_by_data.parents('.form-group').find('label span').html('*')
field_by_data.closest('.form-group').find('label span').html('*')
field_by_data.closest('.form-group').addClass('is-required')
optional: (name, el = @form) ->
@ -434,11 +434,11 @@ class App.ControllerForm extends App.Controller
if @constructor.fieldIsMandatory(field_by_name)
field_by_name.attr('required', false)
field_by_name.parents('.form-group').find('label span').html('')
field_by_name.closest('.form-group').find('label span').html('')
field_by_name.closest('.form-group').removeClass('is-required')
if @constructor.fieldIsMandatory(field_by_data)
field_by_data.attr('required', false)
field_by_data.parents('.form-group').find('label span').html('')
field_by_data.closest('.form-group').find('label span').html('')
field_by_data.closest('.form-group').removeClass('is-required')
readonly: (name, el = @form) ->

View file

@ -2,6 +2,7 @@ class App.ControllerObserver extends App.Controller
model: 'Ticket'
template: 'tba'
globalRerender: true
lastAttributes: undefined
###
observe:
@ -25,7 +26,7 @@ class App.ControllerObserver extends App.Controller
# rerender, e. g. on language change
if @globalRerender
@controllerBind('ui:rerender', =>
@lastAttributres = undefined
@lastAttributes = undefined
@maybeRender(App[@model].fullLocal(@object_id))
)
@ -43,32 +44,40 @@ class App.ControllerObserver extends App.Controller
if !@subscribeId
@subscribeId = object.subscribe(@subscribe)
# remember current attributes
return if !@hasChanged(object)
@render(object)
hasChanged: (object) =>
currentAttributes = {}
objectCloned = $.extend(true, {}, object)
if @observe
for key, active of @observe
if active
currentAttributes[key] = object[key]
if active && !_.isFunction(value)
currentAttributes[key] = objectCloned[key]
if @observeNot
for key, value of object
if key isnt 'cid' && !@observeNot[key] && !_.isFunction(value) && !_.isObject(value)
for key, value of objectCloned
if key isnt 'cid' && !@observeNot[key] && !_.isFunction(value)
currentAttributes[key] = value
if !@lastAttributres
@lastAttributres = {}
else
diff = difference(currentAttributes, @lastAttributres)
if !@lastAttributes
@lastAttributes = currentAttributes
return true
diff = difference(currentAttributes, @lastAttributes)
if _.isEmpty(diff)
@log 'debug', 'maybeRender no diff, no rerender'
return
return false
@log 'debug', 'maybeRender.diff', diff, @observe, @model
@lastAttributres = currentAttributes
@lastAttributes = currentAttributes
@render(object, diff)
true
render: (object, diff) =>
@log 'debug', 'render', @template, object, diff
render: (object) =>
@log 'debug', 'render', @template, object
@html App.view(@template)(
object: object
)

View file

@ -493,14 +493,6 @@ class App.ControllerTable extends App.Controller
sortable: @dndCallback
))
getGroupByKeyName: (object, groupBy) ->
reference_key = groupBy + '_id'
if reference_key of object
return reference_key
groupBy
sortObjectKeys: (objects, direction) ->
sorted = Object.keys(objects).sort()
@ -523,7 +515,7 @@ class App.ControllerTable extends App.Controller
objectsToShow = @objectsOfPage(@pagerShownPage)
if @groupBy
# group by raw (and not printable) value so dates work also
objectsGrouped = _.groupBy(objectsToShow, (object) => object[@getGroupByKeyName(object, @groupBy)])
objectsGrouped = _.groupBy(objectsToShow, (object) => @groupObjectName(object, @groupBy, excludeTags: ['date', 'datetime']))
else
objectsGrouped = { '': objectsToShow }
@ -863,11 +855,15 @@ class App.ControllerTable extends App.Controller
@objects = localObjects
@lastSortedobjects = localObjects
groupObjectName: (object, key = undefined) ->
groupObjectName: (object, key = undefined, options = {}) ->
group = object
if key
if key not of object
key += '_id'
# return internal value if needed
return object[key] if options.excludeTags && _.find(@attributesList, (attr) -> attr.name == key && _.contains(options.excludeTags, attr.tag))
group = App.viewPrint(object, key, @attributesList)
if _.isEmpty(group)
group = ''

View file

@ -0,0 +1,9 @@
class App.ControllerTechnicalErrorModal extends App.ControllerModal
head: "StatusCode: #{status}"
contentCode: ''
buttonClose: false
buttonSubmit: 'Ok'
onSubmit: (e) -> @close(e)
content: ->
"<pre><code>#{@contentCode}</code></pre>"

View file

@ -428,20 +428,7 @@ class ChannelEmailAccountWizard extends App.ControllerWizardModal
ui.hide('options::folder')
ui.hide('options::keep_on_server')
handlePort = (params, attribute, attributes, classname, form, ui) ->
return if !params
return if !params.options
currentPort = @$('[name="options::port"]').val()
if params.options.ssl is true
if !currentPort || currentPort is '143'
@$('[name="options::port"]').val('993')
return
if params.options.ssl is false
if !currentPort || currentPort is '993'
@$('[name="options::port"]').val('143')
return
new App.ControllerForm(
form = new App.ControllerForm(
el: @$('.base-inbound-settings'),
model:
configure_attributes: configureAttributesInbound
@ -449,10 +436,16 @@ class ChannelEmailAccountWizard extends App.ControllerWizardModal
params: @account.inbound
handlers: [
showHideFolder,
handlePort,
]
)
form.el.find("select[name='options::ssl']").off('change').on('change', (e) ->
if $(e.target).val() is 'true'
form.el.find("[name='options::port']").val('993')
else
form.el.find("[name='options::port']").val('143')
)
toggleOutboundAdapter: =>
# fill user / password based on intro info

View file

@ -60,6 +60,30 @@ class Form extends App.Controller
placetel_token: App.Setting.get('placetel_token')
)
configure_attributes = [
{
name: 'view_limit',
display: '',
tag: 'select',
null: false,
options: [
{ name: 60, value: 60 }
{ name: 120, value: 120 }
{ name: 180, value: 180 }
{ name: 240, value: 240 }
{ name: 300, value: 300 }
]
},
]
new App.ControllerForm(
el: @$('.js-viewLimit')
model:
configure_attributes: configure_attributes,
params:
view_limit: @config['view_limit']
autofocus: false
)
updateCurrentConfig: =>
config = @config
cleanupInput = @cleanupInput
@ -70,6 +94,10 @@ class Form extends App.Controller
default_caller_id = @$('input[name=default_caller_id]').val()
config.outbound.default_caller_id = cleanupInput(default_caller_id)
# default view limit
view_limit = @$('select[name=view_limit]').val()
config.view_limit = parseInt(view_limit)
# routing table
config.outbound.routing_table = []
@$('.js-outboundRouting .js-row').each(->

View file

@ -59,17 +59,42 @@ class Form extends App.Controller
config: @config
)
configure_attributes = [
{
name: 'view_limit',
display: '',
tag: 'select',
null: false,
options: [
{ name: 60, value: 60 }
{ name: 120, value: 120 }
{ name: 180, value: 180 }
{ name: 240, value: 240 }
{ name: 300, value: 300 }
]
},
]
new App.ControllerForm(
el: @$('.js-viewLimit')
model:
configure_attributes: configure_attributes,
params:
view_limit: @config['view_limit']
autofocus: false
)
updateCurrentConfig: =>
config = @config
cleanupInput = @cleanupInput
config.api_user = cleanupInput(@$('input[name=api_user]').val())
config.api_password = cleanupInput(@$('input[name=api_password]').val())
# default caller_id
default_caller_id = @$('input[name=default_caller_id]').val()
config.outbound.default_caller_id = cleanupInput(default_caller_id)
# default view limit
view_limit = @$('select[name=view_limit]').val()
config.view_limit = parseInt(view_limit)
# routing table
config.outbound.routing_table = []
@$('.js-outboundRouting .js-row').each(->

View file

@ -96,6 +96,8 @@ class App.UiElement.ApplicationSelector
# ignore passwords and relations
if row.type isnt 'password' && row.name.substr(row.name.length-4,4) isnt '_ids' && row.searchable isnt false
config = _.clone(row)
if config.tag is 'textarea'
config.expanding = false
if config.type is 'email' || config.type is 'tel'
config.type = 'text'
for operatorRegEx, operator of operators_type

View file

@ -46,7 +46,7 @@ class App.UiElement.ApplicationUiElement
result = []
for row in selection
if attribute.translate
row.name = App.i18n.translateInline(row.name)
row.name = App.i18n.translatePlain(row.name)
if !_.isEmpty(row.children)
row.children = @getConfigOptionListArray(attribute, row.children)
result.push row
@ -65,7 +65,7 @@ class App.UiElement.ApplicationUiElement
for key in order
name_new = selection[key]
if attribute.translate
name_new = App.i18n.translateInline(name_new)
name_new = App.i18n.translatePlain(name_new)
attribute.options.push {
name: name_new
value: key
@ -162,7 +162,7 @@ class App.UiElement.ApplicationUiElement
nameNew = item.name
if attribute.translate
nameNew = App.i18n.translateInline(nameNew)
nameNew = App.i18n.translatePlain(nameNew)
row =
value: item.id,

View file

@ -0,0 +1,9 @@
# coffeelint: disable=camel_case_classes
class App.UiElement.auth_provider
@render: (attribute) ->
for key, value of App.Config.get('auth_provider_all')
continue if value.config isnt attribute.provider
attribute.value = "#{App.Config.get('http_type')}://#{App.Config.get('fqdn')}#{value.url}/callback"
break
$( App.view('generic/auth_provider')( attribute: attribute ) )

View file

@ -155,4 +155,4 @@ class App.UiElement.basedate
clear: 'clear'
}
App.i18n.translateDeep(data)
App.i18n.translateDeepPlain(data)

View file

@ -50,15 +50,15 @@ class App.UiElement.core_workflow_condition extends App.UiElement.ApplicationSel
operatorsType =
'active$': ['is']
'boolean$': ['is', 'is not', 'is set', 'not set']
'integer$': ['is', 'is not', 'is set', 'not set']
'^select$': ['is', 'is not', 'is set', 'not set']
'^tree_select$': ['is', 'is not', 'is set', 'not set']
'^(input|textarea|richtext)$': ['is', 'is not', 'is set', 'not set', 'regex match', 'regex mismatch']
'boolean$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
'integer$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
'^select$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
'^tree_select$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
'^(input|textarea|richtext)$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to', 'regex match', 'regex mismatch']
operatorsName =
'_id$': ['is', 'is not', 'is set', 'not set']
'_ids$': ['is', 'is not', 'is set', 'not set']
'_id$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
'_ids$': ['is', 'is not', 'is set', 'not set', 'has changed', 'changed to']
# merge config
elements = {}
@ -153,6 +153,8 @@ class App.UiElement.core_workflow_condition extends App.UiElement.ApplicationSel
# ignore passwords and relations
if row.type isnt 'password' && row.name.substr(row.name.length-4,4) isnt '_ids' && row.searchable isnt false
config = _.clone(row)
if config.tag is 'textarea'
config.expanding = false
if config.tag is 'select'
config.multiple = true
config.default = undefined
@ -175,7 +177,7 @@ class App.UiElement.core_workflow_condition extends App.UiElement.ApplicationSel
currentOperator = elementRow.find('.js-operator option:selected').attr('value')
name = @buildValueName(elementFull, elementRow, groupAndAttribute, elements, meta, attribute)
if _.contains(['is set', 'not set'], currentOperator)
if _.contains(['is set', 'not set', 'has changed'], currentOperator)
elementRow.find('.js-value').addClass('hide').html('<input type="hidden" name="' + name + '" value="true" />')
return

View file

@ -128,7 +128,7 @@ class App.UiElement.core_workflow_perform extends App.UiElement.ApplicationSelec
super(elementFull, elementRow, groupAndAttribute, elements, meta, attribute)
@buildValueConfigMultiple: (config, meta) ->
if _.contains(['add_option', 'remove_option', 'set_fixed_to'], meta.operator)
if _.contains(['add_option', 'remove_option', 'set_fixed_to', 'select'], meta.operator)
config.multiple = true
config.nulloption = true
else

View file

@ -244,7 +244,7 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
params: params
)
configureAttributes = [
{ name: 'data_option::diff', display: 'Default time Diff (minutes)', tag: 'integer', null: false, default: 24 },
{ name: 'data_option::diff', display: 'Default time Diff (minutes)', tag: 'integer', null: true },
]
datetimeDiff = new App.ControllerForm(
model:
@ -258,7 +258,7 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
@date: (item, localParams, params) ->
configureAttributes = [
{ name: 'data_option::diff', display: 'Default time Diff (hours)', tag: 'integer', null: false, default: 24 },
{ name: 'data_option::diff', display: 'Default time Diff (hours)', tag: 'integer', null: true },
]
dateDiff = new App.ControllerForm(
model:

View file

@ -27,6 +27,8 @@ class App.UiElement.richtext
renderFile = (file) ->
item.find('.attachments').append(App.view('generic/attachment_item')(file))
attachments.push file
if form.richTextUploadRenderCallback
form.richTextUploadRenderCallback(attribute, attachments)
if params && params.attachments
for file in params.attachments
@ -54,6 +56,8 @@ class App.UiElement.richtext
return if item.id.toString() is id.toString()
item
)
if form.richTextUploadDeleteCallback
form.richTextUploadDeleteCallback(attribute, attachments)
form_id = item.closest('form').find('[name=form_id]').val()

View file

@ -8,9 +8,11 @@ class App.UiElement.sla_times
item = $( App.view('generic/sla_times')(
attribute: attribute
first_response_time: params.first_response_time
response_time: params.response_time
update_time: params.update_time
solution_time: params.solution_time
first_response_time_in_text: @toText(params.first_response_time)
response_time_in_text: @toText(params.response_time)
update_time_in_text: @toText(params.update_time)
solution_time_in_text: @toText(params.solution_time)
) )
@ -26,12 +28,16 @@ class App.UiElement.sla_times
row = element.closest('tr')
if element.prop('checked')
row.addClass('is-active')
if row.has('.js-updateTypeSelector').length > 0 && row.has('.js-updateTypeSelector:checked').length == 0
row.find('.js-updateTypeSelector:first').prop('checked', true)
else
row.removeClass('is-active')
# reset data item
row.find('.js-timeConvertFrom').val('')
row.find('.js-timeConvertTo').val('')
row.find('.js-updateTypeSelector').attr('checked', false)
row.find('.help-inline').empty()
row.removeClass('has-error')
)
@ -42,12 +48,16 @@ class App.UiElement.sla_times
inText = element.val()
row = element.closest('tr')
row.find('.js-activateRow').prop('checked', true)
row
.find('.js-activateRow')
.prop('checked', true)
.trigger('change')
row.addClass('is-active')
element
.closest('td')
.find('.js-timeConvertTo')
row
.find("[name='#{element.data('name')}']")
.val(@toMinutes(inText) || '')
)
@ -56,9 +66,19 @@ class App.UiElement.sla_times
$(e.currentTarget).closest('tr').find('.checkbox-replacement').click()
)
# toggle update type on clicking around the element
item.find('.js-forward-radio').bind('click', (e) ->
elem = $(e.currentTarget).closest('p').find('.js-updateTypeSelector')
elem.prop('checked', true)
elem.trigger('change')
)
# focus time input on clicking surrounding cell
item.find('.js-focus-input').bind('click', (e) ->
$(e.currentTarget).find('.form-control').focus()
$(e.currentTarget)
.find('.form-control:visible')
.focus()
)
# show placeholder instead of 00:00
@ -67,15 +87,36 @@ class App.UiElement.sla_times
$(e.currentTarget).val('')
)
# switch update/response times when type is selected accordingly
item.find('.js-updateTypeSelector').bind('change', (e) ->
element = $(e.target)
row = element.closest('tr')
row.find('.js-activateRow').prop('checked', true)
row.addClass('is-active')
row
.find('.js-timeConvertFrom')
.addClass('hidden')
.val('')
row
.find('.js-timeConvertTo')
.val('')
row
.find("[data-name='#{element.val()}_time']")
.removeClass('hidden')
)
# set initial active/inactive rows
item.find('.js-timeConvertFrom').each(->
row = $(@).closest('tr')
checkbox = row.find('.js-activateRow')
if $(@).val()
return if !$(@).val()
checkbox.prop('checked', true)
row.addClass('is-active')
else
checkbox.prop('checked', false)
)
item

View file

@ -4,6 +4,7 @@ class App.UiElement.textarea
fileUploaderId = 'file-uploader-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 )
item = $( App.view('generic/textarea')( attribute: attribute ) + '<div class="file-uploader ' + attribute.class + '" id="' + fileUploaderId + '"></div>' )
if attribute.expanding isnt false
a = ->
visible = $( item[0] ).is(':visible')
if visible && !$( item[0] ).expanding('active')

View file

@ -48,12 +48,15 @@ class App.TicketCreate extends App.Controller
if @ticket_id && @article_id
@split = "/#{@ticket_id}/#{@article_id}"
load = (data) =>
@ajax(
type: 'GET'
url: "#{@apiPath}/ticket_create"
processData: true
success: (data, status, xhr) =>
App.Collection.loadAssets(data.assets)
@formMeta = data.form_meta
@buildScreen(params)
@bindId = App.TicketCreateCollection.bind(load, false)
App.TicketCreateCollection.fetch()
)
# rerender view, e. g. on langauge change
@controllerBind('ui:rerender', =>
@ -69,9 +72,6 @@ class App.TicketCreate extends App.Controller
@sidebarWidget.render(@params())
)
release: =>
App.TicketCreateCollection.unbindById(@bindId)
currentChannel: =>
if !type
type = @$('.type-tabs .tab.active').data('type')
@ -282,8 +282,15 @@ class App.TicketCreate extends App.Controller
return if !@formMeta
App.QueueManager.run(@queueKey)
updateTaskManagerAttachments: (attribute, attachments) =>
taskData = App.TaskManager.get(@taskKey)
return if _.isEmpty(taskData)
taskData.attachments = attachments
App.TaskManager.update(@taskKey, taskData)
render: (template = {}) ->
return if !@formMeta
# get params
params = @prefilledParams || {}
if template && !_.isEmpty(template.options)
@ -330,7 +337,6 @@ class App.TicketCreate extends App.Controller
model: App.Ticket
screen: 'create_middle'
handlersConfig: handlers
filter: @formMeta.filter
formMeta: @formMeta
params: params
noFieldset: true
@ -359,8 +365,6 @@ class App.TicketCreate extends App.Controller
events:
'change [name=customer_id]': @localUserInfo
handlersConfig: handlersTunnel
filter: @formMeta.filter
formMeta: @formMeta
autofocus: true
params: params
taskKey: @taskKey
@ -376,6 +380,8 @@ class App.TicketCreate extends App.Controller
handlersConfig: handlersTunnel
params: params
taskKey: @taskKey
richTextUploadRenderCallback: @updateTaskManagerAttachments
richTextUploadDeleteCallback: @updateTaskManagerAttachments
)
@controllerFormCreateBottom = new App.ControllerForm(
el: @$('.ticket-form-bottom')
@ -383,8 +389,6 @@ class App.TicketCreate extends App.Controller
model: App.Ticket
screen: 'create_bottom'
handlersConfig: handlersTunnel
filter: @formMeta.filter
formMeta: @formMeta
params: params
taskKey: @taskKey
)

View file

@ -1,4 +1,4 @@
class TicketCreateFormHanderSignature
class TicketCreateFormHandlerSignature
@run: (params, attribute, attributes, classname, form, ui) ->
return if !attribute
@ -19,9 +19,6 @@ class TicketCreateFormHanderSignature
if App.Utils.signatureCheck(currentBody.html() || '', signatureFinished)
# if signature has changed, in case remove old signature
signature_id = ui.el.closest('.content').find('[data-signature=true]').data('signature-id')
if signature_id && signature_id.toString() isnt signature.id.toString()
ui.el.closest('.content').find('[data-signature="true"]').remove()
if !App.Utils.htmlLastLineEmpty(currentBody)
@ -35,4 +32,4 @@ class TicketCreateFormHanderSignature
else
ui.el.closest('.content').find('[data-name="body"]').find('[data-signature=true]').remove()
App.Config.set('200-ticketFormSignature', TicketCreateFormHanderSignature, 'TicketCreateFormHandler')
App.Config.set('200-ticketFormSignature', TicketCreateFormHandlerSignature, 'TicketCreateFormHandler')

View file

@ -13,13 +13,7 @@ class CustomerTicketCreate extends App.ControllerAppContent
@form_id = App.ControllerForm.formId()
@navupdate '#customer_ticket_new'
load = (data) =>
App.Collection.loadAssets(data.assets)
@formMeta = data.form_meta
@render()
@bindId = App.TicketCreateCollection.bind(load, false)
App.TicketCreateCollection.fetch()
render: (template = {}) ->
if !@Config.get('customer_ticket_create')
@ -43,8 +37,6 @@ class CustomerTicketCreate extends App.ControllerAppContent
form_id: @form_id
model: App.Ticket
screen: 'create_middle'
filter: @formMeta.filter
formMeta: @formMeta
params: defaults
noFieldset: true
handlersConfig: handlers
@ -70,8 +62,6 @@ class CustomerTicketCreate extends App.ControllerAppContent
model: App.Ticket
screen: 'create_top'
handlersConfig: handlersTunnel
filter: @formMeta.filter
formMeta: @formMeta
autofocus: true
params: defaults
)
@ -83,8 +73,6 @@ class CustomerTicketCreate extends App.ControllerAppContent
events:
'fileUploadStart .richtext': => @submitDisable()
'fileUploadStop .richtext': => @submitEnable()
filter: @formMeta.filter
formMeta: @formMeta
params: defaults
handlersConfig: handlersTunnel
)
@ -95,8 +83,6 @@ class CustomerTicketCreate extends App.ControllerAppContent
model: App.Ticket
screen: 'create_bottom'
handlersConfig: handlersTunnel
filter: @formMeta.filter
formMeta: @formMeta
params: defaults
)

View file

@ -91,20 +91,7 @@ class GettingStartedChannelEmail extends App.ControllerWizardFullScreen
ui.hide('options::folder')
ui.hide('options::keep_on_server')
handlePort = (params, attribute, attributes, classname, form, ui) ->
return if !params
return if !params.options
currentPort = @$('.base-inbound-settings [name="options::port"]').val()
if params.options.ssl is true
if !currentPort
@$('.base-inbound-settings [name="options::port"]').val('993')
return
if params.options.ssl is false
if !currentPort || currentPort is '993'
@$('.base-inbound-settings [name="options::port"]').val('143')
return
new App.ControllerForm(
form = new App.ControllerForm(
el: @$('.base-inbound-settings')
model:
configure_attributes: configureAttributesInbound
@ -112,10 +99,16 @@ class GettingStartedChannelEmail extends App.ControllerWizardFullScreen
params: @account.inbound
handlers: [
showHideFolder,
handlePort,
]
)
form.el.find("select[name='options::ssl']").off('change').on('change', (e) ->
if $(e.target).val() is 'true'
form.el.find("[name='options::port']").val('993')
else
form.el.find("[name='options::port']").val('143')
)
toggleOutboundAdapter: =>
# fill user / password based on intro info

View file

@ -165,7 +165,7 @@ class ImportFreshdesk extends App.ControllerWizardFullScreen
@$('.js-error').addClass('hide')
if !_.isEmpty(data.finished_at) && _.isEmpty(data.result['error'])
window.location.reload()
@redirectToLogin()
return
if !_.isEmpty(data.result)

View file

@ -163,7 +163,7 @@ class ImportZendesk extends App.ControllerWizardFullScreen
@$('.js-error').addClass('hide')
if !_.isEmpty(data.finished_at) && _.isEmpty(data.result['error'])
window.location.reload()
@redirectToLogin()
return
if !_.isEmpty(data.result)

View file

@ -247,8 +247,6 @@ class Edit extends App.ControllerGenericEdit
#if attribute.name is 'data_type'
# attribute.disabled = true
console.log('configure_attributes', configure_attributes)
@controller = new App.ControllerForm(
model:
configure_attributes: configure_attributes

View file

@ -153,7 +153,7 @@ class Object extends App.ControllerObserver
elLocal.find('.js-userList').html(members)
)
if @organization.member_ids.length < @memberLimit
if @organization.member_ids.length <= @memberLimit
@el.find('.js-showMoreMembers').parent().addClass('hidden')
else
@el.find('.js-showMoreMembers').parent().removeClass('hidden')
@ -202,7 +202,7 @@ class Object extends App.ControllerObserver
value = $(e.target).html()
org = App.Organization.find(@object_id)
if org[name] isnt value
@lastAttributres[name] = value
@lastAttributes[name] = value
data = {}
data[name] = value
org.updateAttributes(data)

View file

@ -171,6 +171,13 @@ class Graph extends App.Controller
backends: @params.backendSelected
)
processData: true
error: (xhr) =>
return if !_.include([401, 403, 404, 422, 502], xhr.status)
@bodyModal = new App.ControllerTechnicalErrorModal(
head: 'Cannot generate report'
contentCode: xhr.responseJSON.error
)
success: (data) =>
@update(data)
@delay(@render, interval, 'report-update', 'page')

View file

@ -56,13 +56,9 @@ class App.Search extends App.Controller
@navupdate(url: '#search', type: 'menu')
return if _.isEmpty(params.query)
@$('.js-search').val(params.query).trigger('change')
return if @shown
@search(1000, true)
@$('.js-search').val(params.query).trigger('keyup')
hide: ->
@shown = false
if @table
@table.hide()
@ -108,6 +104,7 @@ class App.Search extends App.Controller
return
# on other keys, show result
@navigate "#search/#{encodeURIComponent(@searchInput.val())}"
@search(0)
empty: =>

View file

@ -26,12 +26,6 @@ class Sla extends App.ControllerSubContent
sortBy: 'name'
)
for sla in slas
if sla.first_response_time
sla.first_response_time_in_text = @toText(sla.first_response_time)
if sla.update_time
sla.update_time_in_text = @toText(sla.update_time)
if sla.solution_time
sla.solution_time_in_text = @toText(sla.solution_time)
sla.rules = App.UiElement.ticket_selector.humanText(sla.condition)
sla.calendar = App.Calendar.find(sla.calendar_id)
@ -95,21 +89,8 @@ class Sla extends App.ControllerSubContent
description: (e) =>
new App.ControllerGenericDescription(
description: App.Calendar.description
description: App.Sla.description
container: @el.closest('.content')
)
toText: (m) ->
m = parseInt(m)
return if !m
minutes = m % 60
hours = Math.floor(m / 60)
if minutes < 10
minutes = "0#{minutes}"
if hours < 10
hours = "0#{hours}"
"#{hours}:#{minutes}"
App.Config.set('Sla', { prio: 2900, name: 'SLAs', parent: '#manage', target: '#manage/slas', controller: Sla, permission: ['admin.sla'] }, 'NavBarAdmin')

View file

@ -206,22 +206,13 @@ class App.TicketOverview extends App.Controller
article: article
)
ticket.article = article
ticket.ajax().update(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
ticket.save(
done: (r) =>
@batchCountIndex++
# refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
console.log('record, settings, details', record, settings, details)
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', error)
})
)
return
@ -234,21 +225,13 @@ class App.TicketOverview extends App.Controller
ticket.owner_id = id
if !_.isEmpty(groupId)
ticket.group_id = groupId
ticket.ajax().update(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
ticket.save(
done: (r) =>
@batchCountIndex++
# refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', settings.error)
})
)
return
@ -259,21 +242,13 @@ class App.TicketOverview extends App.Controller
#console.log "perform action #{action} with id #{id} on ", $(item).val()
ticket = App.Ticket.find($(item).val())
ticket.group_id = id
ticket.ajax().update(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
ticket.save(
done: (r) =>
@batchCountIndex++
# refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', error)
})
)
return

View file

@ -501,8 +501,14 @@ class App.TicketZoom extends App.Controller
defaults: @taskGet('article')
taskKey: @taskKey
ui: @
callbackFileUploadStart: @submitDisable
callbackFileUploadStop: @submitEnable
richTextUploadStartCallback: @submitDisable
richTextUploadRenderCallback: (attachments) =>
@submitEnable()
@taskUpdateAttachments('article', attachments)
@delay(@markForm, 250, 'ticket-zoom-form-update')
richTextUploadDeleteCallback: (attachments) =>
@taskUpdateAttachments('article', attachments)
@delay(@markForm, 250, 'ticket-zoom-form-update')
)
@highligher = new App.TicketZoomHighlighter(
@ -641,6 +647,7 @@ class App.TicketZoom extends App.Controller
# update changes in ui
currentStore = @currentStore()
modelDiff = @formDiff(currentParams, currentStore)
return if _.isEmpty(modelDiff)
# set followup state if needed
@setDefaultFollowUpState(modelDiff, currentStore)
@ -720,7 +727,7 @@ class App.TicketZoom extends App.Controller
# add attachments if exist
attachmentCount = @$('.article-add .textBubble .attachments .attachment').length
if attachmentCount > 0
currentParams.article.attachments = true
currentParams.article.attachments = attachmentCount
else
delete currentParams.article.attachments
@ -735,6 +742,14 @@ class App.TicketZoom extends App.Controller
# do not compare null or undefined value
if currentStore.ticket
# make sure that the compared state is same in local storage and
# rendered html. Else we could have race conditions of data
# which is not rendered yet
renderedUpdatedAt = @el.find('.edit').attr('data-ticket-updated-at')
return if !renderedUpdatedAt
return if currentStore.ticket.updated_at.toString() isnt renderedUpdatedAt
for key, value of currentStore.ticket
if value is null || value is undefined
currentStore.ticket[key] = ''
@ -969,15 +984,14 @@ class App.TicketZoom extends App.Controller
processData: true
success: (data) =>
#App.SessionStorage.set(@key, data)
@load(data, true, true)
# reset article - should not be resubmitted on next ticket update
ticket.article = undefined
# reset form after save
@reset()
@load(data, false, true)
if @sidebarWidget
@sidebarWidget.commit()
@ -1070,6 +1084,13 @@ class App.TicketZoom extends App.Controller
App.TaskManager.update(@taskKey, taskData)
taskUpdateAttachments: (area, attachments) =>
taskData = App.TaskManager.get(@taskKey)
return if !taskData
taskData.attachments = attachments
App.TaskManager.update(@taskKey, taskData)
taskUpdateAll: (data) =>
@localTaskData = data
@localTaskData.article['form_id'] = @form_id
@ -1092,7 +1113,7 @@ class App.TicketZoom extends App.Controller
@localTaskData =
ticket: {}
article: {}
App.TaskManager.update(@taskKey, { 'state': @localTaskData })
App.TaskManager.update(@taskKey, { 'state': @localTaskData, attachments: [] })
renderOverviewNavigator: (parentEl) ->
new App.TicketZoomOverviewNavigator(

View file

@ -257,7 +257,7 @@ class EmailReply extends App.Controller
quote_header = App.FullQuoteHeader.fullQuoteHeaderForward(article)
body = "<br/><div>---Begin forwarded message:---<br/><br/></div><div><blockquote type=\"cite\">#{quote_header}#{body}</blockquote></div><div><br></div>"
body = "<br/><div>---#{App.i18n.translateInline('Begin forwarded message')}:---<br/><br/></div><div><blockquote type=\"cite\">#{quote_header}#{body}</blockquote></div><div><br></div>"
articleNew = {}
articleNew.body = body

View file

@ -24,7 +24,7 @@ class Internal
internal = true
if article.internal == true
internal = false
ui.lastAttributres.internal = internal
ui.lastAttributes.internal = internal
article.updateAttributes(internal: internal)
# runtime update

View file

@ -198,17 +198,17 @@ class App.TicketZoomArticleNew extends App.Controller
inputField: @$('.article-attachment input')
onFileStartCallback: =>
@callbackFileUploadStart?()
@richTextUploadStartCallback?()
onFileCompletedCallback: (response) =>
@attachments.push response.data
@renderAttachment(response.data)
@$('.article-attachment input').val('')
@callbackFileUploadStop?()
@richTextUploadRenderCallback?(@attachments)
onFileAbortedCallback: =>
@callbackFileUploadStop?()
@richTextUploadRenderCallback?(@attachments)
attachmentPlaceholder: @attachmentPlaceholder
attachmentUpload: @attachmentUpload
@ -287,7 +287,6 @@ class App.TicketZoomArticleNew extends App.Controller
params.preferences ||= {}
params.preferences.security = @paramsSecurity()
params.attachments = @attachments
params
validate: =>
@ -624,6 +623,8 @@ class App.TicketZoomArticleNew extends App.Controller
$(e.currentTarget).closest('.attachment').remove()
if element.find('.attachment').length == 0
element.empty()
@richTextUploadDeleteCallback?(@attachments)
)
actions: ->

View file

@ -221,7 +221,7 @@ class ArticleViewItem extends App.ControllerObserver
el: @$('.js-article-actions')
ticket: @ticket
article: article
lastAttributres: @lastAttributres
lastAttributes: @lastAttributes
form_id: @form_id
)
@ -305,13 +305,17 @@ class ArticleViewItem extends App.ControllerObserver
e.stopPropagation()
article_id = $(e.target).closest('.ticket-article-item').data('id')
article = App.TicketArticle.find(article_id)
@ajax(
id: 'retrySecurityProcess'
type: 'POST'
url: "#{@apiPath}/ticket_articles/#{article_id}/retry_security_process"
processData: true
success: (data, status, xhr) =>
success: (encryption_data, status, xhr) =>
for data in encryption_data
continue if article.preferences.security.type isnt data.type
if data.sign.success
@notify
type: 'success'

View file

@ -79,6 +79,12 @@ class App.FormHandlerCoreWorkflow
return if !App.WebSocket.channel()
return !App.Config.get('core_workflow_ajax_mode')
@restrictValuesAttributeCache: (attribute, values) ->
result = { values: values }
return result if !attribute.relation
result.lastUpdatedAt = App[attribute.relation].lastUpdatedAt()
return result
# restricts the dropdown and tree select values of a form
@restrictValues: (classname, form, ui, attributes, params, data) ->
return if _.isEmpty(data.restrict_values)
@ -111,17 +117,17 @@ class App.FormHandlerCoreWorkflow
# cache state for performance and only run
# if values or param differ
if coreWorkflowRestrictions?[classname]?[item.name]
compare = values
compare = App.FormHandlerCoreWorkflow.restrictValuesAttributeCache(attribute, values)
continue if _.isEqual(coreWorkflowRestrictions[classname][item.name], compare)
coreWorkflowRestrictions[classname] ||= {}
coreWorkflowRestrictions[classname][item.name] = values
coreWorkflowRestrictions[classname][item.name] = App.FormHandlerCoreWorkflow.restrictValuesAttributeCache(attribute, values)
valueFound = false
for value in values
# false values are valid values e.g. for boolean fields (be careful)
if value isnt undefined && paramValue isnt undefined
if value isnt undefined && paramValue isnt undefined && value isnt null && paramValue isnt null
if value.toString() == paramValue.toString()
valueFound = true
break
@ -133,6 +139,11 @@ class App.FormHandlerCoreWorkflow
if valueFound
item.default = paramValue
item.newValue = paramValue
else if params.id
obj = App[ui.model.className].find(params.id)
if obj && obj[item.name]
item.default = obj[item.name]
item.newValue = obj[item.name]
else
item.default = ''
item.newValue = ''
@ -299,6 +310,11 @@ class App.FormHandlerCoreWorkflow
screen: ui.screen
}
# send last changed attribute only once for has changed condition
if ui.lastChangedAttribute
requestData.last_changed_attribute = ui.lastChangedAttribute
ui.lastChangedAttribute = '-'
if App.FormHandlerCoreWorkflow.useWebSockets()
App.WebSocket.send(requestData)
else
@ -324,8 +340,12 @@ class App.FormHandlerCoreWorkflow
# get params and add id from ui if needed
params = App.FormHandlerCoreWorkflow.cleanParams(params_ref)
if ui?.params?.id
# add object id for edit screens
if ui?.params?.id && ui.screen.match(/edit/)
params.id = ui.params.id
else
delete params.id
# skip double checks
return if _.isEqual(coreWorkflowParams[classname], params)

View file

@ -29,9 +29,15 @@ class Edit extends App.Controller
# for the new ticket + eventually changed task state
@formMeta.core_workflow = undefined
if followUpPossible == 'new_ticket' && ticketState != 'closed' ||
followUpPossible != 'new_ticket' ||
@permissionCheck('admin') || @ticket.currentView() is 'agent'
editable = @ticket.editable()
if followUpPossible == 'new_ticket' && ticketState != 'closed' || followUpPossible != 'new_ticket' || @permissionCheck('admin') || @ticket.currentView() is 'agent'
editable = !editable
# reset updated_at for the sidbar because we render a new state
# it is used to compare the ticket with the rendered data later
# and needed to prevent race conditions
@el.removeAttr('data-ticket-updated-at')
@controllerFormSidebarTicket = new App.ControllerForm(
elReplace: @el
model: { className: 'Ticket', configure_attributes: @formMeta.configure_attributes || App.Ticket.configure_attributes }
@ -40,23 +46,7 @@ class Edit extends App.Controller
filter: @formMeta.filter
formMeta: @formMeta
params: defaults
isDisabled: !@ticket.editable()
taskKey: @taskKey
core_workflow: {
callbacks: [@markForm]
}
#bookmarkable: true
)
else
@controllerFormSidebarTicket = new App.ControllerForm(
elReplace: @el
model: { className: 'Ticket', configure_attributes: @formMeta.configure_attributes || App.Ticket.configure_attributes }
screen: 'edit'
handlersConfig: handlers
filter: @formMeta.filter
formMeta: @formMeta
params: defaults
isDisabled: @ticket.editable()
isDisabled: editable
taskKey: @taskKey
core_workflow: {
callbacks: [@markForm]
@ -64,6 +54,8 @@ class Edit extends App.Controller
#bookmarkable: true
)
# set updated_at for the sidbar because we render a new state
@el.attr('data-ticket-updated-at', defaults.updated_at)
@markForm(true)
return if @resetBind

View file

@ -19,7 +19,7 @@ class App.TicketZoomTitle extends App.ControllerObserver
title = $(e.target).ceg() || ''
# update title
return if title is @lastAttributres.title
return if title is @lastAttributes.title
ticket = App.Ticket.find(@object_id)
ticket.title = title

View file

@ -220,7 +220,7 @@ class Object extends App.ControllerObserver
value = $(e.target).html()
user = App.User.find(@object_id)
if user[name] isnt value
@lastAttributres[name] = value
@lastAttributes[name] = value
data = {}
data[name] = value
user.updateAttributes(data)

View file

@ -33,7 +33,7 @@ class App.WidgetOrganization extends App.Controller
elLocal.find('.js-userList').html(members)
)
if @organization.member_ids.length < @memberLimit
if @organization.member_ids.length <= @memberLimit
@el.find('.js-showMoreMembers').parent().addClass('hidden')
else
@el.find('.js-showMoreMembers').parent().removeClass('hidden')

View file

@ -14,6 +14,7 @@ class App.ObjectOrganizationAutocompletion extends App.Controller
'click': 'stopPropagation'
'change .js-objectId': 'executeCallback'
'click .js-remove': 'removeThisToken'
'click .js-showMoreMembers': 'showMoreMembers'
elements:
'.recipientList': 'recipientList'
@ -251,14 +252,42 @@ class App.ObjectOrganizationAutocompletion extends App.Controller
objectCount: objectCount
)
showMoreMembers: (e) ->
@preventDefaultAndStopPropagation(e)
memberElement = $(e.target).closest('.js-showMoreMembers')
oldMemberLimit = memberElement.attr('organization-member-limit')
newMemberLimit = (parseInt(oldMemberLimit / 25) + 1) * 25
memberElement.attr('organization-member-limit', newMemberLimit)
@renderMembers(memberElement, oldMemberLimit, newMemberLimit)
renderMembers: (element, fromMemberLimit, toMemberLimit) ->
id = element.closest('.recipientList-organizationMembers').attr('organization-id')
organization = App.Organization.find(id)
# only first 10 members else we would need more ajax requests
organization.members(fromMemberLimit, toMemberLimit, (users) =>
for user in users
element.before(@buildObjectItem(user))
if element.closest('ul').hasClass('is-shown')
@showOrganizationMembers(undefined, element.closest('ul'))
)
if organization.member_ids.length <= toMemberLimit
element.addClass('hidden')
else
element.removeClass('hidden')
buildOrganizationMembers: (organization) =>
organizationMemebers = $( App.view(@templateOrganizationItemMembers)(
organizationMembers = $( App.view(@templateOrganizationItemMembers)(
organization: organization
) )
if organization[@referenceAttribute]
for objectId in organization[@referenceAttribute]
object = App[@objectSingle].fullLocal(objectId)
organizationMemebers.append(@buildObjectItem(object))
@renderMembers(organizationMembers.find('.js-showMoreMembers'), 0, 10)
organizationMembers
buildObjectItem: (object) =>
icon = @objectIcon
@ -404,8 +433,7 @@ class App.ObjectOrganizationAutocompletion extends App.Controller
e.stopPropagation()
listEntry = $(e.currentTarget)
organizationId = listEntry.data('organization-id')
organizationId = listEntry.data('organization-id') || listEntry.attr('organization-id')
@organizationList = @$("[organization-id=#{ organizationId }]")
return if !@organizationList.get(0)

View file

@ -102,12 +102,18 @@ class _ajaxSingleton
# do not show any error message with code 502
return if status is 502
try
json = JSON.parse(detail)
text = json.error_human || json.error
text = detail if !text
escaped = App.Utils.htmlEscape(text)
# show error message
new App.ControllerModal(
new App.ControllerTechnicalErrorModal(
contentCode: escaped
head: "StatusCode: #{status}"
contentInline: "<pre>#{App.Utils.htmlEscape(detail)}</pre>"
buttonClose: true
buttonSubmit: false
)
)

View file

@ -28,7 +28,7 @@ class App.FullQuoteHeader
@fullQuoteHeaderForwardTo: (article) ->
if article.type.name is 'email' || article.type.name is 'web'
@fullQuoteHeaderEnsurePrivacy(article.to) || article.to
@fullQuoteHeaderEnsureMultiPrivacy(article.to)
else if article.sender.name is 'Customer' && article.type.name is 'phone'
if email_address_id = App.Group.findByAttribute('name', article.to)?.email_address_id
App.EmailAddress.find(email_address_id).displayName()
@ -36,15 +36,17 @@ class App.FullQuoteHeader
article.to
else if article.sender.name is 'Agent' && article.type.name is 'phone'
ticket = App.Ticket.find article.ticket_id
@fullQuoteHeaderEnsurePrivacy(ticket.customer_id) || @fullQuoteHeaderEnsurePrivacy(article.to) || article.to
@fullQuoteHeaderEnsurePrivacy(ticket.customer_id) || @fullQuoteHeaderEnsureMultiPrivacy(article.to)
else
article.to
@fullQuoteHeaderForwardCC: (article) ->
return if !article.cc
@fullQuoteHeaderEnsureMultiPrivacy(article.cc)
article
.cc
@fullQuoteHeaderEnsureMultiPrivacy: (input) ->
return if !input
input
.split(',')
.map (elem) ->
elem.trim()

View file

@ -8,7 +8,12 @@ class App.i18n
@translateDeep: (input, args...) ->
if _instance == undefined
_instance ?= new _i18nSingleton()
_instance.translateDeep(input, args)
_instance.translateDeep(input, args, false)
@translateDeepPlain: (input, args...) ->
if _instance == undefined
_instance ?= new _i18nSingleton()
_instance.translateDeep(input, args, true)
@translateContent: (string, args...) ->
if _instance == undefined
@ -230,15 +235,18 @@ class _i18nSingleton extends Spine.Module
return string if !string
@translate(string, args, true)
translateDeep: (input, args) =>
translateDeep: (input, args, plain) =>
if _.isArray(input)
_.map input, (item) =>
@translateDeep(item, args)
@translateDeep(item, args, plain)
else if _.isObject(input)
_.reduce _.keys(input), (memo, item) =>
memo[item] = @translateDeep(input[item])
memo[item] = @translateDeep(input[item], args, plain)
memo
, {}
else
if plain
@translatePlain(input, args)
else
@translateInline(input, args)

View file

@ -1,27 +0,0 @@
class _Singleton extends App._CollectionSingletonBase
event: 'ticket_create_attributes'
restEndpoint: '/ticket_create'
class App.TicketCreateCollection
_instance = new _Singleton
@get: ->
_instance.get()
@one: (callback, init = true) ->
_instance.bind(callback, init, true)
@bind: (callback, init = true) ->
_instance.bind(callback, init, false)
@unbind: (callback) ->
_instance.unbind(callback)
@unbindById: (id) ->
_instance.unbindById(id)
@trigger: ->
_instance.trigger()
@fetch: ->
_instance.fetch()

View file

@ -1327,7 +1327,7 @@ class App.Utils
if type is 'email' && !e.attrs.value.match(/@/) || e.attrs.value.match(/\s/)
e.preventDefault()
return false
e.attrs.label = e.attrs.value
e.attrs.label ||= e.attrs.value
true
)
App.Delay.set(a, 500, undefined, 'tags')

View file

@ -654,6 +654,11 @@
var tokensBefore = this.getTokensList()
this.setTokens( this.$input.val(), true )
// remove token text was cleared while editing
if (this.$input.data( 'edit' ) && !this.$input.val()) {
this.$element.val( this.getTokensList() )
}
if (tokensBefore == this.getTokensList() && this.$input.val().length)
return false // No tokens were added, do nothing (prevent form submit)

View file

@ -114,12 +114,23 @@
sel = window.getSelection()
if (sel) {
node = $(sel.anchorNode)
if (node && node.parent() && node.parent().is('blockquote')) {
if (node.closest('blockquote').length > 0) {
// Special handling when the line is not wrapped inside of a html element.
if (!node.is('div') && node.parent().is('blockquote') && node.text()) {
e.preventDefault()
document.execCommand('Insertparagraph')
document.execCommand('Outdent')
document.execCommand('formatBlock', false, 'div')
document.execCommand('insertParagraph')
return
}
if (!e.shiftKey && node && (node.is('blockquote') || (node.parent() && node.parent().is('blockquote')) || !node.text())) {
e.preventDefault()
document.execCommand('insertParagraph')
document.execCommand('outdent')
return
}
}
}
// behavior to enter new line on alt+enter

View file

@ -48,10 +48,26 @@ App.ViewHelpers =
# Output like "1:01" or "4:03:59" or "123:03:59"
mins = "0#{mins}" if mins < 10
secs = "0#{secs}" if secs < 10
if hrs > 0
return "#{hrs}:#{mins}:#{secs}"
"#{mins}:#{secs}"
# define time_duration / hh:mm
time_duration_hh_mm: (time_in_minutes) ->
return '' if !time_in_minutes
return '' if isNaN(parseInt(time_in_minutes))
# Hours, minutes and seconds
hrs = ~~parseInt((time_in_minutes / 60))
mins = ~~parseInt((time_in_minutes % 60))
hrs = "0#{hrs}" if hrs < 10
mins = "0#{mins}" if mins < 10
"#{hrs}:#{mins}"
# define mask helper
# mask an value like 'a***********yz'
M: (item, start = 1, end = 2) ->

View file

@ -234,7 +234,6 @@ class Singleton extends Base
failResponse: (options) =>
(xhr, statusText, error, settings) =>
if options.failResponseNoTrigger isnt true
switch settings.type
when 'POST' then @createFailed()
when 'DELETE' then @destroyFailed()
@ -247,7 +246,6 @@ class Singleton extends Base
details = JSON.parse(detailsRaw)
options.fail?.call(@record, settings, details)
if options.failResponseNoTrigger isnt true
@record.trigger('destroy', @record)
# /add errors to calllback

View file

@ -916,20 +916,25 @@ set new attributes of model (remove already available attributes)
# use jquery instead of ._clone() because we need a deep copy of the obj
@org_configure_attributes = $.extend(true, [], @configure_attributes)
configure_attributes = $.extend(true, [], @configure_attributes)
allAttributes = []
for attribute in attributes
@attributes.push attribute.name
found = false
for attribute_model, index in @configure_attributes
for attribute_model, index in configure_attributes
continue if attribute_model.name != attribute.name
@configure_attributes[index] = _.extend(attribute_model, attribute)
allAttributes.push $.extend(true, attribute_model, attribute)
configure_attributes.splice(index, 1) # remove found attribute
found = true
break
if !found
@configure_attributes.push attribute
allAttributes.push $.extend(true, {}, attribute)
@configure_attributes = $.extend(true, [], allAttributes.concat(configure_attributes))
@resetAttributes: ->
return if _.isEmpty(@org_configure_attributes)

View file

@ -6,8 +6,8 @@ class App.ObjectManagerAttribute extends App.Model
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false },
{ name: 'display', display: 'Display', tag: 'input', type: 'text', limit: 100, null: false },
{ name: 'object', display: 'Object', tag: 'input', readonly: 1 },
{ name: 'position', display: 'Position', tag: 'input', readonly: 1 },
{ name: 'active', display: 'Active', tag: 'active', default: true },
{ name: 'data_type', display: 'Format', tag: 'object_manager_attribute', null: false },
{ name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 },
{ name: 'position', display: 'Position', tag: 'integer', type: 'number', limit: 100, null: true },
]

View file

@ -36,7 +36,7 @@ Using **Organisations** you can **group** customers. This has among others two i
userResult = ->
users = []
for user_id in member_ids
user = App.User.find(user_id)
user = App.User.fullLocal(user_id)
continue if !user
users.push(user)
return users

View file

@ -1,5 +1,5 @@
class App.Sla extends App.Model
@configure 'Sla', 'name', 'first_response_time', 'update_time', 'solution_time', 'condition', 'calendar_id'
@configure 'Sla', 'name', 'first_response_time', 'response_time', 'update_time', 'solution_time', 'condition', 'calendar_id'
@extend Spine.Model.Ajax
@url: @apiPath + '/slas'
@configure_attributes = [
@ -12,6 +12,7 @@ class App.Sla extends App.Model
{ name: 'updated_by_id', display: 'Updated by', relation: 'User', readonly: 1 },
{ name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 },
{ name: 'first_response_time',skipRendering: true },
{ name: 'response_time', skipRendering: true },
{ name: 'update_time', skipRendering: true },
{ name: 'solution_time', skipRendering: true },
]

View file

@ -14,7 +14,7 @@
</div>
<div class="form-group js-sure">
<h3 class="danger-color"><%- @T('Warning') %></h3>
<p class="danger-color"><%- @T('There is no rollback of this deletion possible. If you are absolutely sure to do this, then type in "%s" into the input.', App.i18n.translateInline('delete').toUpperCase()) %></p>
<p class="danger-color"><%- @T('There is no rollback of this deletion possible. If you are absolutely sure to do this, then type in "%s" into the input.', App.i18n.translatePlain('delete').toUpperCase()) %></p>
<%- @sure_html %>
</div>
</div>

View file

@ -0,0 +1 @@
<input type="text" disabled="disabled" readonly="readonly" value="<%= @attribute.value %>" class="form-control" />

View file

@ -20,8 +20,8 @@
<td data-day="<%- id %>" data-slot="<%- slot %>" class="form-group day-time<%- ' is-active' if @hours[id].active %>">
<label for="<%- id %>_start_time">from</label>
<input type="text" id="<%- id %>_start_time" name="<%= @attribute.name %>::<%- id %>::start" value="<%- @hours[id].timeframes[slot][0] %>" data-day="<%- id %>" data-slot="<%- slot %>" data-i="0" class="form-control form-control--small time js-time">
<label for="monday_end_time">till</label>
<input type="text" id="monday_end_time" name="<%= @attribute.name %>::<%- id %>::end" value="<%- @hours[id].timeframes[slot][1] %>" data-day="<%- id %>" data-slot="<%- slot %>" data-i="1" class="form-control form-control--small time js-time">
<label for="<%- id %>_end_time">till</label>
<input type="text" id="<%- id %>_end_time" name="<%= @attribute.name %>::<%- id %>::end" value="<%- @hours[id].timeframes[slot][1] %>" data-day="<%- id %>" data-slot="<%- slot %>" data-i="1" class="form-control form-control--small time js-time">
<% else: %>
<td class="empty-cell">
<% end %>

View file

@ -3,7 +3,7 @@
<% if @attribute.multiple: %>
<%- @tokens %>
<% end %>
<input name="<%- @attribute.name %>_completion" class="user-select token-input js-objectSelect" autocapitalize="off" placeholder="<%- @Ti(@attribute.placeholder) %>" autocomplete="off" <%= @attribute.autofocus %> role="textbox" aria-autocomplete="list" value="<%= @name %>" aria-haspopup="true">
<input name="<%= @attribute.name %>_completion" class="user-select token-input js-objectSelect form-control" autocapitalize="off" placeholder="<%- @Ti(@attribute.placeholder) %>" autocomplete="off" <%= @attribute.autofocus %> role="textbox" aria-autocomplete="list" value="<%= @name %>" aria-haspopup="true">
<% if @attribute.disableCreateObject isnt true: %><%- @Icon('arrow-down', 'dropdown-arrow') %><% end %>
</div>

View file

@ -4,4 +4,9 @@
<%- @Icon('arrow-left') %>
<span class="btn-label"><%- @T('Back') %></span>
</div>
<li class="recipientList-controls js-showMoreMembers" organization-member-limit="10">
<div class="btn btn--action btn--onDark">
<span class="btn-label"><%- @T('show more') %></span>
</div>
</ul>

View file

@ -6,7 +6,7 @@
<th><%- @T('Time') %> <span class="text-muted"><%- @T('in hours') %></span>
</thead>
<tbody>
<tr class="form-group">
<tr>
<td class="u-positionOrigin">
<label class="checkbox-replacement checkbox-replacement--fullscreen dont-grey-out">
<input type="checkbox" class="js-activateRow" id="first_response_time" name="first_response_time_enabled">
@ -16,25 +16,51 @@
<td class="u-clickable js-forward-click">
<div><%- @T('First Response Time') %></div>
<p class="subtle"><%- @T('Timeframe for the first response.') %></p>
<td class="u-clickable js-focus-input">
<td class="u-clickable js-focus-input form-group">
<input type="hidden" name="first_response_time" value="<%= @first_response_time %>" class="js-timeConvertTo">
<input type="text" value="<%= @first_response_time_in_text %>" class="form-control form-control--small timeframe js-timeConvertFrom" placeholder="hh:mm" name="first_response_time_in_text" data-name="first_response_time">
<tr class="form-group">
<tr>
<td class="u-positionOrigin">
<label class="checkbox-replacement checkbox-replacement--fullscreen dont-grey-out">
<input type="checkbox" class="js-activateRow" id="update_time" name="update_time_enabled">
<%- @Icon('checkbox', 'icon-unchecked') %>
<%- @Icon('checkbox-checked', 'icon-checked') %>
</label>
<td class="u-clickable js-forward-click">
<div><%- @T('Update Time') %></div>
<p class="subtle"><%- @T('Timeframe for every following response.') %></p>
<td>
<input type="hidden" name="update_time" value="<%= @update_time %>" class="js-timeConvertTo">
<input type="text" value="<%= @update_time_in_text %>" class="form-control form-control--small timeframe js-timeConvertFrom" placeholder="hh:mm" name="update_time_in_text" data-name="update_time">
<div class="u-clickable js-forward-click">
<div><%- @T('Update Time') %></div>
<p class="subtle"><%- @T('Timeframe between agent updates or for an agent to respond.') %></p>
</div>
<tr class="form-group">
<p class="sla_radio_container js-forward-radio">
<label class="inline-label radio-replacement">
<input class="js-updateTypeSelector" type="radio" name="update_type" value="update" <% if @update_time: %>checked<% end %>>
<%- @Icon('radio', 'icon-unchecked') %>
<%- @Icon('radio-checked', 'icon-checked') %>
<span class="label-text"><%- @T('between agent updates') %></span>
</label>
</p>
<p class="sla_radio_container js-forward-radio u-clickable">
<label class="inline-label radio-replacement">
<input class="js-updateTypeSelector" type="radio" name="update_type" value="response" <% if @response_time: %>checked<% end %>>
<%- @Icon('radio', 'icon-unchecked') %>
<%- @Icon('radio-checked', 'icon-checked') %>
<span class="label-text"><%- @T('for an agent to respond') %></span>
</label>
</p>
<td class="form-group u-clickable js-focus-input u-clickable">
<span class="form-group">
<input type="hidden" name="update_time" value="<%= @update_time %>" class="js-timeConvertTo">
<input type="text" value="<%= @update_time_in_text %>" class="form-control form-control--small timeframe js-timeConvertFrom <% if @response_time: %>hidden<% end %>" placeholder="hh:mm" name="update_time_in_text" data-name="update_time">
</span>
<span class="form-group">
<input type="hidden" name="response_time" value="<%= @response_time %>" class="js-timeConvertTo">
<input type="text" value="<%= @response_time_in_text %>" class="form-control form-control--small timeframe js-timeConvertFrom <% if !@response_time: %>hidden<% end %>" placeholder="hh:mm" name="response_time_in_text" data-name="response_time">
</span>
<tr>
<td class="u-positionOrigin">
<label class="checkbox-replacement checkbox-replacement--fullscreen dont-grey-out">
<input type="checkbox" id="solution_time" class="js-activateRow" name="solution_time_enabled">
@ -44,7 +70,7 @@
<td class="u-clickable js-forward-click">
<div><%- @T('Solution Time') %></div>
<p class="subtle"><%- @T('Timeframe for solving the problem.') %></p>
<td>
<td class="form-group u-clickable js-focus-input">
<input type="hidden" name="solution_time" value="<%= @solution_time %>" class="js-timeConvertTo">
<input type="text" value="<%= @solution_time_in_text %>" class="form-control form-control--small timeframe js-timeConvertFrom" placeholder="hh:mm" name="solution_time_in_text" data-name="solution_time">

View file

@ -82,7 +82,7 @@
<table class="settings-list" style="width: 100%;">
<thead>
<tr>
<th width="50%"><%- @T('Name') %>
<th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Description') %>
</thead>
<tbody>

View file

@ -91,24 +91,30 @@
</tbody>
</table>
</div>
-->
<p><%- @T('Default caller id.') %>
<p><%- @T('Settings') %>
<div class="settings-entry">
<table class="settings-list" style="width: 100%;">
<thead>
<tr>
<th width="50%"><%- @T('Default caller id') %>
<th width="50%"><%- @T('Note') %>
<th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Description') %>
</thead>
<tbody>
<!--
<tr>
<td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary">
<td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %>
-->
<tr>
<td class="settings-list-control-cell js-viewLimit">
<td class="settings-list-row-control"><%- @T('Shown records in caller log.') %>
</tbody>
</table>
</div>
-->
<h2><%- @T('User assignment to telephones') %></h2>
<p><%- @T('User assignment to telephones to be able to offer extended like open new ticket screen on answering a call.') %>

View file

@ -79,38 +79,22 @@
</table>
</div>
<p><%- @T('Default caller id.') %>
<p><%- @T('Settings') %>
<div class="settings-entry">
<table class="settings-list" style="width: 100%;">
<thead>
<tr>
<th width="50%"><%- @T('Default caller id') %>
<th width="50%"><%- @T('Note') %>
<th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Description') %>
</thead>
<tbody>
<tr>
<td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary">
<td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %>
</tbody>
</table>
</div>
<p><%- @T('In order for Zammad to access %s, a %s API user and password must be stored here', 'Sipgate', 'Sipgate') %>:<p>
<div class="settings-entry">
<table class="settings-list" style="width: 100%;">
<thead>
<tr>
<th width="20%"><%- @T('Type') %>
<th width="80%"><%- @T('Content') %>
</thead>
<tbody>
<tr>
<td class="settings-list-row-control"><%- @T('API User') %>
<td class="settings-list-control-cell"><input type="input" class="form-control form-control--small js-select" value="<%= @config.api_user %>" name="api_user" placeholder="someuser@example.com">
<tr>
<td class="settings-list-row-control"><%- @T('API Password') %>
<td class="settings-list-control-cell"><input type="password" class="form-control form-control--small js-select" value="<%= @config.api_password %>" name="api_password" placeholder="">
<td class="settings-list-control-cell js-viewLimit">
<td class="settings-list-row-control"><%- @T('Shown records in caller log.') %>
</tbody>
</table>
</div>

View file

@ -55,6 +55,7 @@
<th class=""><%- @T('Display') %></th>
<th class=""><%- @T('Name') %></th>
<th class="" style="width: 200px;"><%- @T('Type') %></th>
<th><%- @T('Position') %></th>
<th class="" style="width: 140px;"><%- @T('Action') %></th>
</tr>
</thead>
@ -64,6 +65,7 @@
<td><%= item.display %></td>
<td><%= item.name %></td>
<td><%= item.data_type %></td>
<td><%= item.position %></td>
<td>
<% if item.to_create is true: %>
<%- @T('will be created') %>

View file

@ -3,7 +3,7 @@
<% if @object.member_ids: %>
<hr>
<div class="popover-block">
<label><%- @T('Members') %></label>
<label><%- @T('Members') %> (<%= @object.member_ids.length %>)</label>
<div class="userList js-userList"></div>
</div>
<% end %>

View file

@ -34,15 +34,19 @@
<div class="action-block action-block--flex">
<div class="label"><%- @T('Escalation Times') %></div>
<% if sla.first_response_time: %>
<%- sla.first_response_time_in_text %> <%- @T('hours') %> - <%- @T('First Response Time') %>
<%- @time_duration_hh_mm(sla.first_response_time) %> <%- @T('hours') %> - <%- @T('First Response Time') %>
<% end %>
<% if sla.response_time: %>
<br>
<%- @time_duration_hh_mm(sla.response_time) %> <%- @T('hours') %> - <%- @T('Response Time') %>
<% end %>
<% if sla.update_time: %>
<br>
<%- sla.update_time_in_text %> <%- @T('hours') %> - <%- @T('Update Time') %>
<%- @time_duration_hh_mm(sla.update_time) %> <%- @T('hours') %> - <%- @T('Update Time') %>
<% end %>
<% if sla.solution_time: %>
<br>
<%- sla.solution_time_in_text %> <%- @T('hours') %> - <%- @T('Solution Time') %>
<%- @time_duration_hh_mm(sla.solution_time) %> <%- @T('hours') %> - <%- @T('Solution Time') %>
<% end %>
<br>
</div>

View file

@ -65,9 +65,9 @@ Date.prototype.getWeek = function() {
function difference(object1, object2) {
var changes = {};
for (var name in object1) {
if (name in object2) {
if (_.isObject(object2[name]) && !_.isArray(object2[name])) {
_.uniq(Object.keys(object1).concat(Object.keys(object2))).forEach(function(name) {
if (name in object1 && name in object2) {
if (_.isObject(object1[name]) && !_.isArray(object1[name]) && _.isObject(object2[name]) && !_.isArray(object2[name])) {
var diff = difference(object1[name], object2[name]);
if (!_.isEmpty(diff)) {
changes[name] = diff;
@ -75,8 +75,10 @@ function difference(object1, object2) {
} else if (!_.isEqual(object1[name], object2[name])) {
changes[name] = object2[name];
}
} else {
changes[name] = object2[name]
}
}
})
return changes;
}

View file

@ -1,39 +1,39 @@
@font-face {
font-family: 'Fira Sans';
src: url('fonts/FiraSans-Bold.eot');
src: url('fonts/FiraSans-Bold.woff2') format('woff2'),
url('fonts/FiraSans-Bold.woff') format('woff'),
url('fonts/FiraSans-Bold.ttf') format('truetype');
src: url('assets/fonts/FiraSans-Bold.eot');
src: url('assets/fonts/FiraSans-Bold.woff2') format('woff2'),
url('assets/fonts/FiraSans-Bold.woff') format('woff'),
url('assets/fonts/FiraSans-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Fira Sans';
src: url('fonts/FiraSans-Regular.eot');
src: url('fonts/FiraSans-Regular.woff2') format('woff2'),
url('fonts/FiraSans-Regular.woff') format('woff'),
url('fonts/FiraSans-Regular.ttf') format('truetype');
src: url('assets/fonts/FiraSans-Regular.eot');
src: url('assets/fonts/FiraSans-Regular.woff2') format('woff2'),
url('assets/fonts/FiraSans-Regular.woff') format('woff'),
url('assets/fonts/FiraSans-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Fira Sans';
src: url('fonts/FiraSans-Medium.eot');
src: url('fonts/FiraSans-Medium.woff2') format('woff2'),
url('fonts/FiraSans-Medium.woff') format('woff'),
url('fonts/FiraSans-Medium.ttf') format('truetype');
src: url('assets/fonts/FiraSans-Medium.eot');
src: url('assets/fonts/FiraSans-Medium.woff2') format('woff2'),
url('assets/fonts/FiraSans-Medium.woff') format('woff'),
url('assets/fonts/FiraSans-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Fira Sans';
src: url('fonts/FiraSans-Light.eot');
src: url('fonts/FiraSans-Light.woff2') format('woff2'),
url('fonts/FiraSans-Light.woff') format('woff'),
url('fonts/FiraSans-Light.ttf') format('truetype');
src: url('assets/fonts/FiraSans-Light.eot');
src: url('assets/fonts/FiraSans-Light.woff2') format('woff2'),
url('assets/fonts/FiraSans-Light.woff') format('woff'),
url('assets/fonts/FiraSans-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}

View file

@ -358,6 +358,26 @@ ol, ul {
z-index: 1;
}
code {
background: hsla(0, 0%, 0%, 0.2);
border-radius: 3px;
box-decoration-break: clone;
}
code,
.hljs {
padding: 2px 4px;
font-size: 0.88em;
}
.hljs {
background: none;
}
pre code.hljs {
font-size: 1em;
}
pre {
display: block;
padding: 9.5px;
@ -371,30 +391,26 @@ pre {
border: 1px solid hsl(0,0%,90%);
border-radius: 3px;
}
.modal-content pre {
background: hsl(0, 0%, 97%);
border: 1px solid hsl(0, 0%, 87%);
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.hljs,
code {
background: none;
padding: 2px 4px;
font-size: 0.88em;
}
border-radius: 0;
border: none;
overflow-x: auto;
code:not(.hljs) {
border: 1px solid rgba(0,0,0,.2);
border-radius: 3px;
white-space: nowrap;
}
pre code.hljs {
font-size: 1em;
&.hljs {
padding: 0;
background: none;
}
}
.textarea::placeholder,
@ -13157,3 +13173,10 @@ span.is-disabled {
.text-modules-box {
max-height: 40vh;
}
.sla_times {
.sla_radio_container {
padding-top: 0.5em;
padding-left: 0.5em;
}
}

View file

@ -43,6 +43,10 @@ module ApplicationController::Authenticates
end
def authentication_check_only(auth_param = {})
if Rails.env.test? && ENV['FAKE_SELENIUM_LOGIN_USER_ID'].present? && session[:user_id].blank?
session[:user_id] = ENV['FAKE_SELENIUM_LOGIN_USER_ID'].to_i
end
# logger.debug 'authentication_check'
# logger.debug params.inspect
# logger.debug session.inspect

View file

@ -38,6 +38,7 @@ class CalendarsController < ApplicationController
end
def destroy
model_references_check(Calendar, params)
model_destroy_render(Calendar, params)
end

View file

@ -149,6 +149,7 @@ curl http://localhost/api/v1/groups/{id} -v -u #{login}:#{password} -H "Content-
=end
def destroy
model_references_check(Group, params)
model_destroy_render(Group, params)
end
end

View file

@ -50,9 +50,9 @@ class ImportFreshdeskController < ApplicationController
Setting.set('import_freshdesk_endpoint_key', params[:token])
result = Sequencer.process('Import::Freshdesk::ConnectionTest')
connection_result = Sequencer.process('Import::Freshdesk::ConnectionTest')
if !result[:connected]
if !connection_result[:connected]
Setting.set('import_freshdesk_endpoint_key', nil)
@ -63,6 +63,19 @@ class ImportFreshdeskController < ApplicationController
return
end
permission_result = Sequencer.process('Import::Freshdesk::PermissionCheck')
if !permission_result[:permission_present]
Setting.set('import_freshdesk_endpoint_key', nil)
render json: {
result: 'invalid',
message_human: 'Missing administrator permission!',
}
return
end
render json: {
result: 'ok',
}

View file

@ -42,9 +42,7 @@ class Integration::SMIMEController < ApplicationController
string = params[:file].read.force_encoding('utf-8')
end
items = string.scan(%r{.+?-+END(?: TRUSTED)? CERTIFICATE-+}mi).each_with_object([]) do |cert, result|
result << SMIMECertificate.create!(public_key: cert)
end
items = SMIMECertificate.create_certificates(string)
render json: {
result: 'ok',
@ -73,14 +71,8 @@ class Integration::SMIMEController < ApplicationController
raise "Parameter 'data' or 'file' required." if string.blank?
private_key = OpenSSL::PKey.read(string, params[:secret])
modulus = private_key.public_key.n.to_s(16)
certificate = SMIMECertificate.find_by(modulus: modulus)
raise Exceptions::UnprocessableEntity, 'Unable for find certificate for this private key.' if !certificate
certificate.update!(private_key: string, private_key_secret: params[:secret])
SMIMECertificate.create_certificates(string)
SMIMECertificate.create_private_keys(string, params[:secret])
render json: {
result: 'ok',

View file

@ -29,7 +29,7 @@ class ObjectManagerAttributesController < ApplicationController
)
raise Exceptions::UnprocessableEntity, 'already exists' if exists
add_attribute_using_params(permitted_params.merge(position: 1550), status: :created)
add_attribute_using_params(permitted_params, status: :created)
end
# PUT /object_manager_attributes/1

View file

@ -22,6 +22,7 @@ class ReportsController < ApplicationController
get_params = params_all
return if !get_params
begin
result = {}
get_params[:metric][:backend].each do |backend|
condition = get_params[:profile].condition
@ -43,6 +44,13 @@ class ReportsController < ApplicationController
current_user: current_user
)
end
rescue => e
if e.message.include? 'Conflicting date range'
raise Exceptions::UnprocessableEntity, 'Conflicting date ranges. Please check your selected report profile.'
end
raise e
end
render json: {
data: result

View file

@ -1,31 +0,0 @@
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
class TicketCreateScreenJob < ApplicationJob
include HasActiveJobLock
def perform
Sessions.list.each do |client_id, data|
next if client_id.blank?
user_id = data&.dig(:user, 'id')
next if user_id.blank?
user = User.lookup(id: user_id)
next if !user&.permissions?('ticket.agent')
# get attributes to update
ticket_create_attributes = Ticket::ScreenOptions.attributes_to_change(
current_user: user,
)
# no data exists
next if ticket_create_attributes.blank?
Rails.logger.debug { "push ticket_create for user #{user.id}" }
Sessions.send(client_id, {
event: 'ticket_create_attributes',
data: ticket_create_attributes,
})
end
end
end

View file

@ -373,18 +373,14 @@ returns
end
# check if sla's are refer to an existing calendar
if destroyed?
default_calendar = Calendar.find_by(default: true)
Sla.find_each do |sla|
if !sla.calendar_id
sla.calendar_id = default_calendar.id
sla.save!
next
end
if !Calendar.exists?(id: sla.calendar_id)
Sla.where(calendar_id: id).find_each do |sla|
sla.calendar_id = default_calendar.id
sla.save!
end
end
true
end

View file

@ -17,7 +17,7 @@ class Channel::Driver::Sms::MessageBird < Channel::Driver::Sms::Base
send_create(options, attr)
true
rescue => e
Rails.logger.debug { "MessageBird error: #{e.inspect}" }
Rails.logger.error { "MessageBird error: #{e.inspect}" }
raise e
end
end

View file

@ -606,6 +606,20 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
if mail.html_part&.body.present?
content_type = mail.html_part.mime_type || 'text/plain'
body = body_text(mail.html_part, strict_html: true)
elsif mail.text_part.present? && mail.all_parts.any? { |elem| elem.inline? && elem.content_type&.start_with?('image') }
content_type = 'text/html'
body = mail
.all_parts
.reduce('') do |memo, part|
if part.mime_type == 'text/plain' && !part.attachment?
memo += body_text(part, strict_html: false).text2html
elsif part.inline? && part.content_type&.start_with?('image')
memo += "<img src=\'cid:#{part.cid}\'>"
end
memo
end
elsif mail.text_part.present?
content_type = 'text/plain'
@ -614,9 +628,6 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
.reduce('') do |memo, part|
if part.mime_type == 'text/plain' && !part.attachment?
memo += body_text(part, strict_html: false)
elsif part.inline? && part.content_type&.start_with?('image')
content_type = 'text/html'
memo += "<img src=\'cid:#{part.cid}\'>"
end
memo

View file

@ -14,8 +14,7 @@ module HasGroupRelationDefinition
validates :access, presence: true
validate :validate_access
after_save :touch_related
after_destroy :touch_related
after_commit :touch_related
end
private

View file

@ -251,7 +251,6 @@ module HasGroups
yield
self.group_access_buffer = nil
cache_delete
push_ticket_create_screen_background_job
end
def process_group_access_buffer

View file

@ -6,9 +6,9 @@ module HasRoles
included do
has_and_belongs_to_many :roles,
before_add: %i[validate_agent_limit_by_role validate_roles],
after_add: %i[cache_update check_notifications push_ticket_create_screen_for_role_change],
after_add: %i[cache_update check_notifications],
before_remove: :last_admin_check_by_role,
after_remove: %i[cache_update push_ticket_create_screen_for_role_change]
after_remove: %i[cache_update]
end
# Checks a given Group( ID) for given access(es) for the instance associated roles.
@ -45,15 +45,6 @@ module HasRoles
)
end
def push_ticket_create_screen_for_role_change(role)
return if Setting.get('import_mode')
permission = Permission.lookup(name: 'ticket.agent')
return if !role.permissions.exists?(id: permission.id)
push_ticket_create_screen_background_job
end
# methods defined here are going to extend the class, not the instance of it
class_methods do

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