= Trac Ticket Template = [[TOC]] SEE:'''ZoomQuiet''' ~ Collection KSPEG Trac hacking == Description == * !TicketTemplate enable users to create ticket using templates which can be customized by Trac administrator and themselves. * Trac administrator can spcify a general system level template '''default''' for all uncustomized ticket types. * System level ticket templates are ticket type specific. * User level ticket templates (ie, my template) can be managed by common users. * This version can work with Trac 0.11/0.12. == Pre-requisites == This plugin requires the [http://pypi.python.org/pypi/simplejson/ simplejson] extension to function. = Changes in version 0.7 = * This version has fully i18n support with Trac `0.12dev-r9098` above. * New feature: support '''My Template'''. Everyone can manage their own templates now. * New feature: template can include any fields, the default field is description. * New feature: support template params that can be specified by URL. == Bugs/Feature Requests == Existing bugs and feature requests for TracTicketTemplatePlugin are [report:9?COMPONENT=TracTicketTemplatePlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=TracTicketTemplatePlugin&owner=richard new ticket]. == Download == Download the zipped source from [download:tractickettemplateplugin here]. == Source == You can check out TracTicketTemplatePlugin from [http://trac-hacks.org/svn/tractickettemplateplugin here] using Subversion, or [source:tractickettemplateplugin browse the source] with Trac. == Install == '''IMPORTANT''': Please BACKUP you ticket templates if you are upgrading this plugin. You can install this software as normal Trac plugin. 1. Uninstall this plugin if you have installed before. 2. Change to the directory containning setup.py. * (Optional): If you are using Trac 0.12 with i18n, you should compile language files here: {{{ python setup.py compile_catalog -f }}} 3. If you want to install this plugin globally, that will install this plugin to the python path: * python setup.py install 4. If you want to install this plugin to trac instance only: * python setup.py bdist_egg * copy the generated egg file to the trac instance's plugin directory {{{ cp dist/*.egg /srv/trac/env/plugins }}} 5. Config trac.ini: {{{ [components] tickettemplate.* = enabled [tickettemplate] field_list = summary, description, reporter, owner, priority, cc, milestone, component, version, type enable_custom = true }}} * Set field_list to choose which field should be included in template. * Set enable_custom to false will disable My Template, which default is true. == About i18n/l10n support == This plugin is prepared for localization. English message texts are the (POSIX) default.[[BR]] Current languages supplied with the plugin are: * English (default) * Chinese(simplified) * Japanese * German * Italian If you can't find the language you want, you could do it yourself. 1. Init your language catalog, take et_EE for example: {{{ python setup.py init_catalog -l et_EE }}} 1. Update catalog {{{ python setup.py update_catalog -l et_EE }}} 1. Do translate with your favorite editor, the language file locate in tickettemplate/loclate/et_EE/LC_MESSAGES/tickettemplate.po * Note: this .po file should be saved with UTF8 encoding. 1. Update catalog again, for normalizing the manual edits: {{{ python setup.py update_catalog -l et_EE }}} 1. Generate the compiled catalog: {{{ python setup.py compile_catalog -f }}} 1. Reinstall the plugin See the [http://trac.edgewall.org/wiki/CookBook/PluginL10N#Dotranslatorswork l10n cookbook page for Trac plugins] for more details. You've done a new translation? Superb! Contributing your translation is highly appreciated.[[BR]] You could send it to the plugin's maintainer or contribute to [TracPluginTranslation Trac plugin l10n project] via [http://www.transifex.net/projects/p/Trac_Plugin-L10N/ Transifex]: Top translations: Trac_Plugin-L10N ยป [http://www.transifex.net/projects/p/Trac_Plugin-L10N/c/tickettemplate/ tickettemplate][[BR]] [[Image(http://www.transifex.net/projects/p/Trac_Plugin-L10N/c/tickettemplate/chart/image_png, title="Go to Trac_Plugin-L10N project page on Transifex.net", link="http://www.transifex.net/projects/p/Trac_Plugin-L10N/c/tracsubtickets/")]] Kindly provided by [[Image(http://sw.transifex.net/2/static/charts/images/tx-logo-micro.png, link=http://www.transifex.net/, title=the open translation platform, valign=bottom)]] == Example == * Trac administrator should define the template for all ticket types: * Login as administrator, open Admin -> Ticket System -> Ticket Template * '''load''' the template of each ticket type, modify them and '''apply changes''' * After defined ticket template, normal user can create ticket using predefined template by '''change ticket types''' dropdown list items. * Screen capture of ''newticket'' page. [[Image(NewTicketPage-v0.7.png,50%)]] * Screen capture of Admin panel. [[Image(AdminTicketTemplatePage-v0.7.png,50%)]] * About template params: * This plugin supports template params which can be specified by URL. For example: * The template: {{{ blah blah %(my_param)s blah blah }}} * Call newticket: {{{ http://yourtrac/newticket?my_param=anything&owner=myname }}} * Rendered: {{{ blah blah anything blah blah }}} * And owner field would be filled by myname by trac's default convention. * Note: be careful choosing template param name, to avoid conflicting with ticket field names. = Prerequisite = * [http://pypi.python.org/pypi/simplejson simplejson] == Recent Changes == [[ChangeLog(tractickettemplateplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:richard] [[BR]] '''Maintainer:''' [wiki:richard] [[BR]] '''Contributors:''' [wiki:hasienda]