Changes between Version 23 and Version 24 of BlackMagicTicketTweaksPlugin
- Timestamp:
- Apr 9, 2015, 11:16:55 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BlackMagicTicketTweaksPlugin
v23 v24 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Various hacks to alter Ticket form behaviour and Ticket Permissions =3 = Various hacks to alter Ticket form behaviour and Ticket Permissions 4 4 5 5 '''Note:''' This hack is available for adoption. 6 6 7 == Description ==7 == Description 8 8 9 Trac in 0.11 provided us with this incredibly powerful and terrible bit of dark power -- the ability to apply Genshi Transformers to the templates before they hit the user. The power is awesome; and with this plugin I have abused that power for evil purposes. 9 Trac 0.11 provides developers and administrators us with the ability to apply Genshi Transformers to the templates before they are presented to the user. This plugin adds the ability to tweak any of the Ticket fields, be they custom or standard, in the following ways: 10 * disable - The field won't be editable. 11 * hide - The field will be invisible. 12 * label - Rename a field, in particular one of the built-in fields. 13 * notice - Add a small notice below a field. 14 * tip - Provide a Javascript tooltip when the control hovers over the field. Useful for example to give people a reminder for the difference between 'priority' and 'severity'. 15 * permission - Set a permission that is required to edit that specific field. This is particularly useful in an environment where you let ''users'' set severity, so they need `TICKET_CHGPROP`, but you only want certain people to be able to edit the Priority. 10 16 11 And there are plans for more evil in the future! 12 13 Basically, the plugin adds the ability to tweak any of the Ticket fields-- be they custom or standard-- in the following ways: 14 * disable - The field won't be editable. 15 * hide - The field will simply be invisible. 16 * label - Rename a field... in particular one of the built-in fields. 17 * notice - Add a small notice below a field. 18 * tip - Provide a pretty java-script tooltip when the control overs over the field. (Useful, for example, to give people a reminder for the difference between 'priority' and 'severity' 19 * permission - Set a permission that is required to edit that specific field. This is particularly useful in an environment where you let ''users'' set severity-- so they need TICKET_CHGPROP-- but you only want certain people to be able to edit the Priority. 20 21 The plugin also lets you define arbitrary permissions, say, MASTER_OF_PRIORITIES, if you want to require someone to have such a custom permission to edit a certain field. 17 The plugin also lets you define arbitrary permissions, say `MASTER_OF_PRIORITIES`, if you want to require someone to have such a custom permission to edit a certain field. 22 18 23 19 The plugin can also deny access to certain ticket types by permissions using the ticket_type ini setting. 24 20 25 == Bugs/Feature Requests ==21 == Bugs/Feature Requests 26 22 27 23 Existing bugs and feature requests for BlackMagicTicketTweaksPlugin are [query:status!=closed&component=BlackMagicTicketTweaksPlugin&order=priority here]. 28 24 29 25 If you have any issues, create a 30 [/newticket?component=BlackMagicTicketTweaksPlugin&owner=obs new ticket] please cc yourself if you're anonymous or you won't be notified of when I respond !26 [/newticket?component=BlackMagicTicketTweaksPlugin&owner=obs new ticket] please cc yourself if you're anonymous or you won't be notified of when I respond. 31 27 32 [ /query?status=new&status=assigned&status=reopened&group=severity&verbose=1&component=BlackMagicTicketTweaksPlugin&order=severity Detailed Tickets]28 [[TicketQuery(component=BlackMagicTicketTweaksPlugin&group=type,format=progress)]] 33 29 34 == Installation and Configuration == 35 36 === Prerequisites === 37 38 Latest Trac 0.11 39 40 === Download === 30 == Download 41 31 42 32 * Download the zipped source from [download:blackmagictickettweaksplugin here]. 43 33 * You can check out BlackMagicTicketTweaksPlugin [/svn/blackmagictickettweaksplugin using Subversion], or [source:blackmagictickettweaksplugin browse the source] with Trac. 44 34 45 == = Installation ===35 == Installation 46 36 47 The easiest way to install the BlackMagicTicketTweaksPlugin is to simply point easy_install at the t-h.o SVN repository, a la: 37 === Prerequisites 38 39 Latest Trac 0.11 or later. 40 41 === Installation steps 42 43 The easiest way to install the BlackMagicTicketTweaksPlugin is to point `easy_install` at the t-h.o SVN repository, such as: 48 44 49 45 {{{ 50 46 #!sh 51 47 easy_install http://trac-hacks.org/svn/blackmagictickettweaksplugin/0.11 52 48 }}} 53 49 54 Alternatively, you may download the source and go into the 0.11 directory and then run:50 Alternatively, you may download the source and go into the Trac 0.11 directory and then run: 55 51 56 52 {{{ 57 53 #!sh 58 54 python setup.py install 59 55 }}} 60 56 61 After you have installed the BlackMagicTicketTweaksPlugin, you must enable it. You can do so in the Administration panel of Trac, or in t rac.iniby adding:57 After you have installed the BlackMagicTicketTweaksPlugin, you must enable it. You can do so in the Administration panel of Trac, or in the `trac.ini` file by adding: 62 58 63 59 {{{ … … 67 63 }}} 68 64 69 == = Configuration ===65 == Configuration 70 66 71 67 Any fields that you would like to tweak with this plugin must be listed in the ''tweaks'' option of the [blackmagic] section in your TracIni. This list is comma-separated and lower case. For example: … … 77 73 }}} 78 74 79 Next you must specify all the actions that you want performed on those fields. You may have as many actions as you'dlike.75 Next you must specify all the actions that you want performed on those fields. You can have as many actions as you like. 80 76 81 The actions are specified as ''<field>.<action> = <value>''77 The actions are specified as `<field>.<action> = <value>`: 82 78 83 79 {{{ … … 93 89 * on 94 90 * 1 95 They are all case insensitive 91 They are all case insensitive. 96 92 97 93 The following actions are supported: 98 94 99 disable:: 100 * If True, the field will be present and its value shown but it won't be editable. By default the label will be striked out, but if you set the ''gray_disabled'' option to some value, that color will be used instead. Suggested value is something like ''#cccccc'' 101 hide:: 102 * If True, the field will be completely removed and so not settable and invisible. 103 label:: 104 * The label for the field will be renamed to this value. Not terribly useful for the custom fields, but it lets you adjust the default fields names. 105 notice:: 106 * Adds a small notice under the field; useful for little notes about the field. 107 tip:: 108 * If the mouse hovers over the field, a pretty little tooltip (javascript required) will pop up offering some explanation. 109 permission:: 110 * A comma-separated list of permissions that the user must have at least one of to edit this field. If they do not, the field will be disabled (as above). This allows per-field permissions. 111 ondenial:: 112 * This only means something on a field with a '''permission''' action set. In this case, it determines how to handle if the user has no such permission. Valid options are either 'disable' (default) or 'hide', both treated as if the field had such an action set as above. 95 disable:: If True, the field will be present and its value shown but it won't be editable. By default the label will be striked out, but if you set the ''gray_disabled'' option to some value, that color will be used instead. Suggested value is `#cccccc`. 96 hide:: If True, the field will be completely removed and so not settable and invisible. 97 label:: The label for the field will be renamed to this value. Not useful for the custom fields, but it lets you adjust the default fields names. 98 notice:: Adds a small notice under the field; useful for annotations on the field. 99 tip:: If the mouse hovers over the field, a little tooltip will pop up offering some explanation. Javascript must be enabled for this to work. 100 permission:: A comma-separated list of permissions that the user must have at least one of to edit this field. If they do not, the field will be disabled (as above). This allows per-field permissions. 101 ondenial:: This only means something on a field with a '''permission''' action set. In this case, it determines how to handle if the user has no such permission. Valid options are either 'disable' (default) or 'hide', both treated as if the field had such an action set as above. 113 102 114 You may create new permissions in Trac for use above (or anywhere you 'd like, really) by specifying the ''permission'' option, as in (this feature is also available in the Trac core as of 0.12, see t:TracPermissions#CreatingNewPrivileges for more details):103 You may create new permissions in Trac for use above (or anywhere you like) by specifying the ''permission'' option, as in: 115 104 116 105 {{{ … … 120 109 }}} 121 110 122 T o deny access to a ticket type by permission use the following options111 This feature is also available in the Trac core as of 0.12, see t:TracPermissions#CreatingNewPrivileges for more details. 123 112 124 ticket_type.* = PERMISSION (replacing * with the ticket type, i.e. defect) 125 I.e. to only allow users with the TICKET_MODIFY permission access to defect tickets you would set the following 113 To deny access to a ticket type by permission use the following options: 114 115 `ticket_type.* = PERMISSION` replacing * with the ticket type, for example `defect`. So to only allow users with the `TICKET_MODIFY` permission access to defect tickets you would set the following: 126 116 {{{ 127 117 #!ini … … 134 124 Currently the ticket_type.* option can only hold one permission, if you want a comma separated list [/newticket?component=BlackMagicTicketTweaksPlugin&owner=obs raise a ticket] and request it. 135 125 136 To use this option you will need to add BlackMagicTicketTweaks to the permission_policies option in the [trac] section of the trac.ini i.e.126 To use this option you will need to add BlackMagicTicketTweaks to the permission_policies option in the [trac] section of the `trac.ini` file: 137 127 138 128 {{{ … … 142 132 }}} 143 133 144 == Example ==134 == Example 145 135 146 136 {{{ … … 156 146 }}} 157 147 158 == Recent Changes ==148 == Recent Changes 159 149 160 150 [[ChangeLog(blackmagictickettweaksplugin, 3)]] 161 151 162 == Author/Contributors ==152 == Author/Contributors 163 153 164 154 '''Author:''' [wiki:ixokai] [[BR]] 165 '''Maintainer:''' ''none''[[BR]]155 '''Maintainer:''' [[Maintainer]] [[BR]] 166 156 '''Contributors:''' obs