Documentation OTRS 6
Total Page:16
File Type:pdf, Size:1020Kb
Documentation OTRS 6 - Developer Manual Build Date: 2016-03-14 OTRS 6 - Developer Manual Copyright © 2003-2016 OTRS AG 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. All trade names are used without the guarantee for their free use and are possibly registered trade marks. All products mentioned in this manual may be trade marks of the respective manufacturer. 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. Table of Contents 1. Getting Started .......................................................................................................... 1 1. Development Environment ................................................................................. 1 1.1. Framework checkout ................................................................................ 1 1.2. Useful Tools .............................................................................................. 1 1.3. Linking Expansion Modules ...................................................................... 1 2. Architecture Overview ........................................................................................ 2 2.1. Directories ................................................................................................ 3 2.2. Files .......................................................................................................... 4 2.3. Core Modules ........................................................................................... 4 2.4. Frontend Handle ....................................................................................... 4 2.5. Frontend Modules ..................................................................................... 5 2.6. CMD Frontend .......................................................................................... 5 2.7. Generic Interface Modules ....................................................................... 5 2.8. Scheduler Task Handler Modules ............................................................. 6 2.9. Database .................................................................................................. 6 2. OTRS Internals - How it Works .................................................................................. 7 1. Config Mechanism .............................................................................................. 7 1.1. Defaults.pm: OTRS Default Configuration .............................................. 7 1.2. Automatically Generated Configuration Files ........................................... 7 1.3. XML Configuration Files ........................................................................... 7 1.4. Accessing Config Options at Runtime .................................................... 15 2. Database Mechanism ....................................................................................... 15 2.1. How it works .......................................................................................... 15 2.2. Database Drivers ................................................................................... 19 2.3. Supported Databases ............................................................................. 19 3. Log Mechanism ................................................................................................. 19 3.1. System Log ............................................................................................ 19 3.2. Communication Log ............................................................................... 19 4. Date and Time ................................................................................................. 22 4.1. Introduction ............................................................................................ 22 4.2. Creation of a DateTime object ............................................................... 22 4.3. Time zones ............................................................................................. 23 4.4. Method summary ................................................................................... 23 4.5. Deprecated package Kernel::System::Time ........................................... 24 5. Skins ................................................................................................................. 24 5.1. Skin Basics ............................................................................................. 24 5.2. How skins are loaded ............................................................................ 25 5.3. Creating a New Skin .............................................................................. 26 6. The CSS and JavaScript "Loader" ..................................................................... 27 6.1. How it works .......................................................................................... 27 6.2. Basic Operation ...................................................................................... 28 6.3. Configuring the Loader: JavaScript ........................................................ 29 6.4. Configuring the Loader: CSS .................................................................. 30 7. Templating Mechanism ..................................................................................... 31 7.1. Template Commands ............................................................................. 31 7.2. Using a template file ............................................................................. 37 8. Creating Your Own Themes .............................................................................. 38 9. Localization / Translation Mechanism ............................................................... 38 9.1. Marking translatable strings in the source files ..................................... 38 9.2. Collecting translatable strings into the translation database ................. 39 9.3. The translation process itself ................................................................. 40 9.4. Using the translated data from the code ............................................... 41 3. How to Extend OTRS ............................................................................................... 42 1. Writing a new OTRS frontend module .............................................................. 42 1.1. What we want to write .......................................................................... 42 iii 1.2. Default Config File ................................................................................. 42 1.3. Frontend Module .................................................................................... 43 1.4. Core Module ........................................................................................... 44 1.5. Template File .......................................................................................... 46 1.6. Language File ......................................................................................... 46 1.7. Summary ................................................................................................ 46 2. Using the power of the OTRS module layers ................................................... 46 2.1. Authentication and user management .................................................. 47 2.2. Preferences ............................................................................................ 54 2.3. Other core functions .............................................................................. 63 2.4. Frontend Modules ................................................................................... 85 2.5. Generic Interface Modules ..................................................................... 93 2.6. Daemon And Scheduler ....................................................................... 113 2.7. Dynamic Fields ..................................................................................... 119 2.8. Email Handling ..................................................................................... 150 4. How to Publish Your OTRS Extensions ................................................................... 153 1. Package Management .................................................................................... 153 1.1. Package Distribution ............................................................................ 153 1.2. Package Commands ............................................................................. 153 2. Package Building ............................................................................................ 154 2.1. Package Spec File ................................................................................ 154 2.2. Example .sopm ..................................................................................... 160 2.3. Package Build ....................................................................................... 161 2.4. Package Life Cycle - Install/Upgrade/Uninstall ..................................... 161 3. Package Porting .............................................................................................. 161 3.1. From OTRS 5 to 6 ................................................................................ 161 3.2. From OTRS 4 to 5 ................................................................................ 176 3.3. From OTRS 3.3 to 4 ............................................................................