OTRS 5 - Developer Manual

This work is copyrighted by OTRS AG. You may copy it in whole or in part as long as the copies retain this copyright statement.

The source code of this document can be found at github, in the repository doc-developer. Contributions are more than welcome. You can also help translating it to your language at Transifex.

UNIX is a registered trademark of X/Open Company Limited. Linux is a registered trademark of Linus Torvalds. MS-DOS, Windows, Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows 2003, Windows Vista and Windows 7 are registered trademarks of Microsoft Corporation. Other trademarks and registered trademarks are: SUSE and YaST of SUSE Linux GmbH, Red Hat and Fedora are registered trademarks of Red Hat, Inc. Mandrake is a registered trademark of MandrakeSoft, SA. Debian is a registered trademark of Software in the Public Interest, Inc. MySQL and the MySQL Logo are registered trademarks of Oracle Corporation and/or its affiliates.

All trade names are used without the guarantee for their free use and are possibly registered trade marks.

OTRS AG essentially follows the notations of the manufacturers. Other products mentioned in this manual may be trademarks of the respective manufacturer.


Table of Contents

1. Getting Started
Development Environment
Framework checkout
Useful Tools
Linking Expansion Modules
Architecture Overview
Directories
Files
Core Modules
Frontend Handle
Frontend Modules
CMD Frontend
Generic Interface Modules
Scheduler Task Handler Modules
Database
2. OTRS Internals - How it Works
Config Mechanism
Defaults.pm: OTRS Default Configuration
Automatically Generated Configuration Files
XML Config Options
Accessing Config Options at Runtime
Database Mechanism
How it works
Database Drivers
Supported Databases
Log Mechanism
Skins
Skin Basics
How skins are loaded
Creating a New Skin
The CSS and JavaScript "Loader"
How it works
Basic Operation
Configuring the Loader: JavaScript
Configuring the Loader: CSS
Templating Mechanism
Template Commands
Using a template file
Localization / Translation Mechanism
Marking translatable strings in the source files
Collecting translatable strings into the translation database
The translation process itself
Using the translated data from the code
3. How to Extend OTRS
Writing a new OTRS frontend module
What we want to write
Default Config File
Frontend Module
Core Module
Template File
Language File
Summary
Using the power of the OTRS module layers
Authentication and user management
Preferences
Other core functions
Frontend Modules
Generic Interface Modules
Scheduler Task Handler Modules
Dynamic Fields
Email Handling
4. How to Publish Your OTRS Extensions
Package Management
Package Distribution
Package Commands
Package Building
Package Spec File
Example .sopm
Package Build
Package Life Cycle - Install/Upgrade/Uninstall
Package Porting
From OTRS 4 to 5
From OTRS 3.3 to 4
5. Contributing to OTRS
Sending Contributions
Translating OTRS
Updating an existing translation
Adding a new frontend translation
Translating the Documentation
Code Style Guide
Perl
JavaScript
CSS
User Interface Design
Capitalization
Accessibility Guide
Accessibility Basics
Accessibility Standards
Implementation guidelines
Unit Tests
Creating a test file
Prerequisites for testing
Testing
UnitTest API
A. Additional Resources

List of Figures

1.1. OTRS Architecture
1.2. Generic Interface Architecture
3.1. Dashboard Widget
3.2. Dynamic Fields Architecture
3.3. Dynamic Field Interaction
3.4. Email Processing Flow
4.1. Package Life Cycle

List of Tables

4.1. Template Changes from OTRS 3.3 to 4