Changeset 4293
- Timestamp:
- 09/18/08 16:02:47 (2 months ago)
- Files:
-
- timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/api.py (modified) (4 diffs)
- timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/reports_filter.py (modified) (1 diff)
- timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/ticket_policy.py (added)
- timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/usermanual.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/api.py
r4267 r4293 8 8 from ticket_webui import * 9 9 from usermanual import * 10 from ticket_policy import * 10 11 from trac.log import logger_factory 11 12 from trac.ticket import ITicketChangeListener, Ticket … … 43 44 estimatedhours.label = Estimated Hours? 44 45 46 internal = checkbox 47 internal.value = 0 48 internal.label = Internal? 49 45 50 """ 46 51 implements(IEnvironmentSetupParticipant) … … 98 103 if self.db_installed_version < 7: 99 104 field_settings = "field settings" 100 self.config.set( field_settings, "fields", "billable, totalhours, hours, estimatedhours " )105 self.config.set( field_settings, "fields", "billable, totalhours, hours, estimatedhours, internal" ) 101 106 self.config.set( field_settings, "billable.permission", "TIME_VIEW:hide, TIME_RECORD:disable" ) 102 107 self.config.set( field_settings, "hours.permission", "TIME_VIEW:remove, TIME_RECORD:disable" ) 103 108 self.config.set( field_settings, "estimatedhours.permission", "TIME_RECORD:disable" ) 109 self.config.set( field_settings, "internal.permission", "TIME_RECORD:hide") 104 110 105 111 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 159 165 ticket_custom = "ticket-custom" 160 166 return not ( self.config.get( ticket_custom, "totalhours" ) and \ 161 162 #self.config.get( ticket_custom, "billable" ) and \ 163 #self.config.get( ticket_custom, "billable.order") and \ 164 #(self.config.get( ticket_custom, "billable" ) == "checkbox") and \ 165 #(not self.config.get( ticket_custom, "lastbilldate" )) and \ 166 167 self.config.get( ticket_custom, "hours" ) and \ 168 self.config.get( ticket_custom, "totalhours.order") and \ 169 self.config.get( ticket_custom, "hours.order") and \ 170 self.config.get( ticket_custom, "estimatedhours.order") and \ 171 self.config.get( ticket_custom, "estimatedhours")) 167 self.config.get( ticket_custom, "hours" ) and \ 168 self.config.get( ticket_custom, "totalhours.order") and \ 169 self.config.get( ticket_custom, "hours.order") and \ 170 self.config.get( ticket_custom, "estimatedhours.order") and \ 171 self.config.get( ticket_custom, "estimatedhours") and \ 172 self.config.get( ticket_custom, "internal") and \ 173 "InternalTicketsPolicy" in self.config.getlist("trac", "permission_policies")) 172 174 173 175 def do_ticket_field_upgrade(self): 174 176 ticket_custom = "ticket-custom" 175 177 176 self.config.set(ticket_custom,"totalhours", "text")177 if not self.config.get( ticket_custom, "totalhours.order") :178 if not self.config.get(ticket_custom,"totalhours"): 179 self.config.set(ticket_custom,"totalhours", "text") 178 180 self.config.set(ticket_custom,"totalhours.order", "4") 179 self.config.set(ticket_custom,"totalhours.value", "0") 180 self.config.set(ticket_custom,"totalhours.label", "Total Hours") 181 182 self.config.set(ticket_custom,"billable", "checkbox") 183 self.config.set(ticket_custom,"billable.value", "1") 184 if not self.config.get( ticket_custom, "billable.order") : 181 self.config.set(ticket_custom,"totalhours.value", "0") 182 self.config.set(ticket_custom,"totalhours.label", "Total Hours") 183 184 185 if not self.config.get(ticket_custom,"billable"): 186 self.config.set(ticket_custom,"billable", "checkbox") 187 self.config.set(ticket_custom,"billable.value", "1") 185 188 self.config.set(ticket_custom,"billable.order", "3") 186 self.config.set(ticket_custom,"billable.label", "Billable?")187 188 self.config.set(ticket_custom,"hours", "text")189 self.config.set(ticket_custom,"hours.value", "0")190 if not self.config.get( ticket_custom, "hours.order") :189 self.config.set(ticket_custom,"billable.label", "Billable?") 190 191 if not self.config.get(ticket_custom,"hours"): 192 self.config.set(ticket_custom,"hours", "text") 193 self.config.set(ticket_custom,"hours.value", "0") 191 194 self.config.set(ticket_custom,"hours.order", "2") 192 self.config.set(ticket_custom,"hours.label", "Add Hours to Ticket")193 194 self.config.set(ticket_custom,"estimatedhours", "text")195 self.config.set(ticket_custom,"estimatedhours.value", "0")196 if not self.config.get( ticket_custom, "estimatedhours.order") :195 self.config.set(ticket_custom,"hours.label", "Add Hours to Ticket") 196 197 if not self.config.get(ticket_custom,"estimatedhours"): 198 self.config.set(ticket_custom,"estimatedhours", "text") 199 self.config.set(ticket_custom,"estimatedhours.value", "0") 197 200 self.config.set(ticket_custom,"estimatedhours.order", "1") 198 self.config.set(ticket_custom,"estimatedhours.label", "Estimated Number of Hours") 201 self.config.set(ticket_custom,"estimatedhours.label", "Estimated Number of Hours") 202 203 if not self.config.get( ticket_custom, "internal"): 204 self.config.set(ticket_custom, "internal", "checkbox") 205 self.config.set(ticket_custom, "internal.value", "0") 206 self.config.set(ticket_custom, "internal.label", "Internal?") 207 self.config.set(ticket_custom,"internal.order", "5") 208 209 if "InternalTicketsPolicy" not in self.config.getlist("trac", "permission_policies"): 210 perms = ["InternalTicketsPolicy"] 211 other_policies = self.config.getlist("trac", "permission_policies") 212 if "DefaultPermissionPolicy" not in other_policies: 213 perms.append("DefaultPermissionPolicy") 214 perms.extend( other_policies ) 215 self.config.set("trac", "permission_policies", ', '.join(perms)) 199 216 200 217 self.config.save(); timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/reports_filter.py
r4282 r4293 61 61 62 62 class ReportScreenFilter(Component): 63 """Hides TandE reports even when you just go to the url""" 63 64 implements(ITemplateStreamFilter) 64 65 def __init__(self): timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/usermanual.py
r4265 r4293 1 1 user_manual_title = "Timing and Estimation Plugin User Manual" 2 user_manual_version = 1 22 user_manual_version = 13 3 3 user_manual_wiki_title = "TimingAndEstimationPluginUserManual" 4 4 user_manual_content = """ … … 108 108 }}} 109 109 110 111 It also adds an "Internal" checkbox which allows you to set a ticket as internal. For this policy to work correctly you need to add a line to the trac section of the config telling it which permission policies to use. (The setup will attempt to put this line of configuration in place. ) The permission that looks at currently is 'TIME_ADMIN'. To change that group set the internalgroup of the ticket section in the trac.ini as follows: 112 113 {{{ 114 #!ini 115 [ticket] 116 internalgroup = TRAC_ADMIN 117 118 [trac] 119 permission_policies = InternalTicketsPolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy 120 }}} 121 122 110 123 == Future Improvements == 111 124 * [http://trac-hacks.org/wiki/TimingAndEstimationPlugin See tickets] at the [http://trac-hacks.org/wiki/TimingAndEstimationPlugin project trac]
