"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170123000002_fixed_translation.rb" (25 Mar 2021, 16331 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "20170123000002_fixed_translation.rb": 3.5.1_vs_4.0.0.

    1 class FixedTranslation < ActiveRecord::Migration[4.2]
    2   def up
    3 
    4     # return if it's a new setup
    5     return if !Setting.exists?(name: 'system_init_done')
    6 
    7     settings_update = [
    8       {
    9         'name'        => 'app_version',
   10         'title'       => nil,
   11         'description' => 'Only used internally to propagate current web app version to clients.',
   12       },
   13       {
   14         'name'        => 'websocket_port',
   15         'title'       => 'Websocket port',
   16         'description' => nil,
   17       },
   18       {
   19         'name'        => 'http_type',
   20         'title'       => 'HTTP type',
   21         'description' => 'Define the http protocol of your instance.',
   22       },
   23       {
   24         'name'        => 'storage_provider',
   25         'title'       => nil,
   26         'description' => '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data in the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.',
   27       },
   28       {
   29         'name'        => 'geo_ip_backend',
   30         'title'       => nil,
   31         'description' => 'Defines the backend for geo IP lookups. Shows also location of an IP address if an IP address is shown.',
   32       },
   33       {
   34         'name'        => 'geo_calendar_backend',
   35         'title'       => nil,
   36         'description' => 'Defines the backend for geo calendar lookups. Used for initial calendar succession.',
   37       },
   38       {
   39         'name'        => 'ui_client_storage',
   40         'title'       => nil,
   41         'description' => 'Use client storage to cache data to enhance performance of application.',
   42       },
   43       {
   44         'name'        => 'password_min_size',
   45         'title'       => 'Minimum length',
   46         'description' => 'Password needs to have at least a minimal number of characters.',
   47       },
   48       {
   49         'name'        => 'password_need_digit',
   50         'title'       => nil,
   51         'description' => 'Password needs to contain at least one digit.',
   52       },
   53       {
   54         'name'        => 'password_max_login_failed',
   55         'title'       => 'Maximum failed logins',
   56         'description' => 'Number of failed logins after account will be deactivated.',
   57       },
   58       {
   59         'name'        => 'ticket_hook',
   60         'title'       => nil,
   61         'description' => 'The identifier for a ticket, e.g. Ticket#, Call#, MyTicket#. The default is Ticket#.',
   62       },
   63       {
   64         'name'        => 'ticket_hook_divider',
   65         'title'       => nil,
   66         'description' => 'The divider between TicketHook and ticket number. E. g. \': \'.',
   67       },
   68       {
   69         'name'        => 'ticket_hook_position',
   70         'title'       => nil,
   71         'description' => "The format of the subject.
   72 * **Right** means **Some Subject [Ticket#12345]**
   73 * **Left** means **[Ticket#12345] Some Subject**
   74 * **None** means **Some Subject** (without ticket number). In the last case you should enable *postmaster_follow_up_search_in* to recognize follow-ups based on email headers and/or body.",
   75       },
   76       {
   77         'name'        => 'customer_ticket_create_group_ids',
   78         'title'       => nil,
   79         'description' => 'Defines groups for which a customer can create tickets via web interface. "-" means all groups are available.',
   80       },
   81       {
   82         'name'        => 'form_ticket_create',
   83         'title'       => nil,
   84         'description' => 'Defines if tickets can be created via web form.',
   85       },
   86       {
   87         'name'        => 'ticket_subject_size',
   88         'title'       => nil,
   89         'description' => 'Max. length of the subject in an email reply.',
   90       },
   91       {
   92         'name'        => 'ticket_subject_re',
   93         'title'       => nil,
   94         'description' => 'The text at the beginning of the subject in an email reply, e.g. RE, AW, or AS.',
   95       },
   96       {
   97         'name'        => 'ticket_define_email_from',
   98         'title'       => nil,
   99         'description' => 'Defines how the From field of emails (sent from answers and email tickets) should look like.',
  100       },
  101       {
  102         'name'        => 'ticket_define_email_from_separator',
  103         'title'       => nil,
  104         'description' => 'Defines the separator between the agent\'s real name and the given group email address.',
  105       },
  106       {
  107         'name'        => 'postmaster_max_size',
  108         'title'       => 'Maximum Email Size',
  109         'description' => 'Maximum size in MB of emails.',
  110       },
  111       {
  112         'name'        => 'postmaster_follow_up_search_in',
  113         'title'       => 'Additional follow-up detection',
  114         'description' => 'By default the follow-up check is done via the subject of an email. With this setting you can add more fields for which the follow-up check will be executed.',
  115       },
  116       {
  117         'name'        => 'send_no_auto_response_reg_exp',
  118         'title'       => nil,
  119         'description' => 'If this regex matches, no notification will be sent by the sender.',
  120       },
  121       {
  122         'name'        => 'api_token_access',
  123         'title'       => nil,
  124         'description' => 'Enable REST API using tokens (not username/email address and password). Each user needs to create its own access tokens in user profile.',
  125       },
  126       {
  127         'name'        => 'monitoring_token',
  128         'title'       => nil,
  129         'description' => 'Token for monitoring.',
  130       },
  131       {
  132         'name'        => 'chat',
  133         'title'       => nil,
  134         'description' => 'Enable/disable online chat.',
  135       },
  136       {
  137         'name'        => 'chat_agent_idle_timeout',
  138         'title'       => nil,
  139         'description' => 'Idle timeout in seconds until agent is set offline automatically.',
  140       },
  141       {
  142         'name'        => 'models_searchable',
  143         'title'       => 'Defines searchable models.',
  144         'description' => 'Defines the searchable models.',
  145       },
  146       {
  147         'name'        => 'default_controller',
  148         'title'       => nil,
  149         'description' => 'Defines the default screen.',
  150       },
  151       {
  152         'name'        => 'es_url',
  153         'title'       => nil,
  154         'description' => 'Defines endpoint of Elasticsearch.',
  155       },
  156       {
  157         'name'        => 'es_user',
  158         'title'       => nil,
  159         'description' => 'Defines HTTP basic auth user of Elasticsearch.',
  160       },
  161       {
  162         'name'        => 'es_password',
  163         'title'       => 'Elasticsearch Endpoint Password',
  164         'description' => 'Defines HTTP basic auth password of Elasticsearch.',
  165       },
  166       {
  167         'name'        => 'es_index',
  168         'title'       => 'Elasticsearch Endpoint Index',
  169         'description' => 'Defines Elasticsearch index name.',
  170       },
  171       {
  172         'name'        => 'es_attachment_ignore',
  173         'title'       => 'Elasticsearch Attachment Extensions',
  174         'description' => 'Defines attachment extensions which will be ignored by Elasticsearch.',
  175       },
  176       {
  177         'name'        => 'es_attachment_max_size_in_mb',
  178         'title'       => 'Elasticsearch Attachment Size',
  179         'description' => nil,
  180       },
  181       {
  182         'name'        => 'import_mode',
  183         'title'       => nil,
  184         'description' => 'Puts Zammad into import mode (disables some triggers).',
  185       },
  186       {
  187         'name'        => 'import_backend',
  188         'title'       => nil,
  189         'description' => 'Set backend which is being used for import.',
  190       },
  191       {
  192         'name'        => 'import_ignore_sla',
  193         'title'       => nil,
  194         'description' => 'Ignore escalation/SLA information for import.',
  195       },
  196       {
  197         'name'        => 'import_otrs_endpoint',
  198         'title'       => nil,
  199         'description' => 'Defines OTRS endpoint to import users, tickets, states and articles.',
  200       },
  201       {
  202         'name'        => 'import_otrs_endpoint_key',
  203         'title'       => nil,
  204         'description' => 'Defines OTRS endpoint authentication key.',
  205       },
  206       {
  207         'name'        => 'import_otrs_user',
  208         'title'       => 'Import User for HTTP basic authentication',
  209         'description' => 'Defines HTTP basic authentication user (only if OTRS is protected via HTTP basic auth).',
  210       },
  211       {
  212         'name'        => 'import_zendesk_endpoint_key',
  213         'title'       => nil,
  214         'description' => 'Defines Zendesk endpoint authentication key.',
  215       },
  216       {
  217         'name'        => 'import_zendesk_endpoint_username',
  218         'title'       => nil,
  219         'description' => 'Defines Zendesk endpoint authentication user.',
  220       },
  221       {
  222         'name'        => 'time_accounting_selector',
  223         'title'       => nil,
  224         'description' => 'Enable time accounting for these tickets.',
  225       },
  226       {
  227         'name'        => 'tag_new',
  228         'title'       => nil,
  229         'description' => 'Allow users to create new tags.',
  230       },
  231       {
  232         'name'        => 'defaults_calendar_subscriptions_tickets',
  233         'title'       => nil,
  234         'description' => 'Defines the default calendar tickets subscription settings.',
  235       },
  236       {
  237         'name'        => 'translator_key',
  238         'title'       => 'Defines translator identifier.',
  239         'description' => nil,
  240       },
  241       {
  242         'name'        => '0010_postmaster_filter_trusted',
  243         'title'       => 'Defines postmaster filter.',
  244         'description' => 'Defines postmaster filter to remove X-Zammad headers from not trusted sources.',
  245       },
  246       {
  247         'name'        => '0012_postmaster_filter_sender_is_system_address',
  248         'title'       => 'Defines postmaster filter.',
  249         'description' => 'Defines postmaster filter to check if email has been created by Zammad itself and will set the article sender.',
  250       },
  251       {
  252         'name'        => '0015_postmaster_filter_identify_sender',
  253         'title'       => 'Defines postmaster filter.',
  254         'description' => 'Defines postmaster filter to identify sender user.',
  255       },
  256       {
  257         'name'        => '0020_postmaster_filter_auto_response_check',
  258         'title'       => 'Defines postmaster filter.',
  259         'description' => 'Defines postmaster filter to identify auto responses to prevent auto replies from Zammad.',
  260       },
  261       {
  262         'name'        => '0030_postmaster_filter_out_of_office_check',
  263         'title'       => 'Defines postmaster filter.',
  264         'description' => 'Defines postmaster filter to identify out-of-office emails for follow-up detection and keeping current ticket state.',
  265       },
  266       {
  267         'name'        => '0100_postmaster_filter_follow_up_check',
  268         'title'       => 'Defines postmaster filter.',
  269         'description' => 'Defines postmaster filter to identify follow-ups (based on admin settings).',
  270       },
  271       {
  272         'name'        => '0900_postmaster_filter_bounce_check',
  273         'title'       => 'Defines postmaster filter.',
  274         'description' => 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
  275       },
  276       {
  277         'name'        => '1000_postmaster_filter_database_check',
  278         'title'       => 'Defines postmaster filter.',
  279         'description' => 'Defines postmaster filter for filters managed via admin interface.',
  280       },
  281       {
  282         'name'        => '5000_postmaster_filter_icinga',
  283         'title'       => 'Defines postmaster filter.',
  284         'description' => 'Defines postmaster filter to manage Icinga (http://www.icinga.org) emails.',
  285       },
  286       {
  287         'name'        => '5100_postmaster_filter_nagios',
  288         'title'       => 'Defines postmaster filter.',
  289         'description' => 'Defines postmaster filter to manage Nagios (http://www.nagios.org) emails.',
  290       },
  291       {
  292         'name'        => 'icinga_integration',
  293         'title'       => nil,
  294         'description' => 'Defines if Icinga (http://www.icinga.org) is enabled or not.',
  295       },
  296       {
  297         'name'        => 'icinga_sender',
  298         'title'       => nil,
  299         'description' => 'Defines the sender email address of Icinga emails.',
  300       },
  301       {
  302         'name'        => 'icinga_auto_close',
  303         'title'       => nil,
  304         'description' => 'Defines if tickets should be closed if service is recovered.',
  305       },
  306       {
  307         'name'        => 'icinga_auto_close_state_id',
  308         'title'       => nil,
  309         'description' => 'Defines the state of auto closed tickets.',
  310       },
  311       {
  312         'name'        => 'nagios_integration',
  313         'title'       => nil,
  314         'description' => 'Defines if Nagios (http://www.nagios.org) is enabled or not.',
  315       },
  316       {
  317         'name'        => 'nagios_sender',
  318         'title'       => nil,
  319         'description' => 'Defines the sender email address of Nagios emails.',
  320       },
  321       {
  322         'name'        => 'nagios_auto_close',
  323         'title'       => nil,
  324         'description' => 'Defines if tickets should be closed if service is recovered.',
  325       },
  326       {
  327         'name'        => 'nagios_auto_close_state_id',
  328         'title'       => nil,
  329         'description' => 'Defines the state of auto closed tickets.',
  330       },
  331       {
  332         'name'        => '0100_trigger',
  333         'title'       => 'Defines sync transaction backend.',
  334         'description' => 'Defines the transaction backend to execute triggers.',
  335       },
  336       {
  337         'name'        => '0100_notification',
  338         'title'       => 'Defines transaction backend.',
  339         'description' => 'Defines the transaction backend to send agent notifications.',
  340       },
  341       {
  342         'name'        => '1000_signature_detection',
  343         'title'       => 'Defines transaction backend.',
  344         'description' => 'Defines the transaction backend to detect customer signatures in emails.',
  345       },
  346       {
  347         'name'        => '6000_slack_webhook',
  348         'title'       => 'Defines transaction backend.',
  349         'description' => 'Defines the transaction backend which posts messages to Slack (http://www.slack.com).',
  350       },
  351       {
  352         'name'        => 'slack_integration',
  353         'title'       => nil,
  354         'description' => 'Defines if Slack (http://www.slack.org) is enabled or not.',
  355       },
  356       {
  357         'name'        => 'slack_config',
  358         'title'       => nil,
  359         'description' => 'Defines the slack config.',
  360       },
  361       {
  362         'name'        => 'sipgate_integration',
  363         'title'       => nil,
  364         'description' => 'Defines if sipgate.io (http://www.sipgate.io) is enabled or not.',
  365       },
  366       {
  367         'name'        => 'sipgate_config',
  368         'title'       => nil,
  369         'description' => 'Defines the sipgate.io config.',
  370       },
  371       {
  372         'name'        => 'clearbit_integration',
  373         'title'       => nil,
  374         'description' => 'Defines if Clearbit (http://www.clearbit.com) is enabled or not.',
  375       },
  376       {
  377         'name'        => 'clearbit_config',
  378         'title'       => nil,
  379         'description' => 'Defines the Clearbit config.',
  380       },
  381       {
  382         'name'        => '9000_clearbit_enrichment',
  383         'title'       => 'Defines transaction backend.',
  384         'description' => 'Defines the transaction backend which will enrich customer and organization information from Clearbit (http://www.clearbit.com).',
  385       },
  386       {
  387         'name'        => '9100_cti_caller_id_detection',
  388         'title'       => 'Defines transaction backend.',
  389         'description' => 'Defines the transaction backend which detects caller IDs in objects and store them for CTI lookups.',
  390       },
  391       {
  392         'name'        => '9200_karma',
  393         'title'       => 'Defines transaction backend.',
  394         'description' => 'Defines the transaction backend which creates the karma score.',
  395       },
  396       {
  397         'name'        => 'karma_levels',
  398         'title'       => 'Defines karma levels.',
  399         'description' => 'Defines the karma levels.',
  400       },
  401     ]
  402 
  403     settings_update.each do |setting|
  404       fetched_setting = Setting.find_by(name: setting['name'] )
  405       next if !fetched_setting
  406 
  407       if setting['title']
  408         fetched_setting.title = setting['title']
  409       end
  410 
  411       if setting['description']
  412         fetched_setting.description = setting['description']
  413       end
  414 
  415       fetched_setting.save!
  416     end
  417 
  418     Translation.sync
  419 
  420   end
  421 end