Modify ↓
Opened 8 years ago
Closed 7 years ago
#13175 closed defect (fixed)
Make compatible with Trac 1.2
Reported by: | Darren | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
TracJsGanttPlugin does not work in 1.2 changing get_db_cnx to get_read_db in tracjsgantt.py and tracpm.py seems to help make it display, but all tasks seem to be 2 days.
Attachments (1)
Change History (7)
comment:1 Changed 7 years ago by
Keywords: | 1.2 gantt timing removed |
---|---|
Summary: | TracJsGanttPlugin → Make compatible with Trac 1.2 |
comment:2 Changed 7 years ago by
Patch for DB API 1.2 and datetime support
-
tracjsgantt.py
old new 406 406 407 407 def _buildEnumMap(field): 408 408 self.classMap = {} 409 db = self.env.get_db_cnx()410 cursor = db.cursor()411 cursor.execute("SELECT name," +409 with self.env.db_query as db: 410 cursor = db.cursor() 411 cursor.execute("SELECT name," + 412 412 db.cast('value', 'int') + 413 413 " FROM enum WHERE type=%s", (field,)) 414 for name, value in cursor:415 self.classMap[name] = value414 for name, value in cursor: 415 self.classMap[name] = value 416 416 417 417 display = None 418 418 colorBy = options['colorBy'] -
tracpm.py
old new 324 324 # otherwise. 325 325 def isSet(self, ticket, field): 326 326 if self.isCfg(field) \ 327 and len(ticket[self.fields[field]]) != 0:327 and isinstance(ticket[self.fields[field]], datetime) and len(str(ticket[self.fields[field]])) != 0: 328 328 return True 329 elif self.isCfg(field) \ 330 and len(ticket[self.fields[field]]) != 0: 331 return True 329 332 else: 330 333 return False 331 334 … … 336 339 if not dateString: 337 340 d = None 338 341 else: 339 d = datetime(*time.strptime(dateString, 342 if isinstance(dateString, datetime): 343 d = dateString 344 else: 345 d = datetime(*time.strptime(dateString, 340 346 self.dbDateFormat)[0:7]) 341 347 d = d.replace(hour=0, minute=0, second=0, microsecond=0, 342 348 tzinfo=localtz)
The patch is not tested yet, but seems to work at first glance.
I will test the patch the next few days.
comment:3 Changed 7 years ago by
Please attach proposed changes as a patch file (TracDev/SubmittingPatches).
comment:4 Changed 7 years ago by
Owner: | changed from Chris Nelson to Ryan J Ollos |
---|---|
Status: | new → accepted |
Note: See
TracTickets for help on using
tickets.
Please use a summary that is consistent with your request.