Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#9177 closed enhancement (wontfix)

[PATCH] Patch and plugin for creating comments and ticket-changes which are only visible for a choosable group

Reported by: michael.henke@… Owned by:
Priority: normal Milestone:
Component: ticket system Version: 0.11-stable
Severity: normal Keywords: patch, plugin, comments, ticket
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Hi there,

as described in the subject I made a modification which allows users to create hideable comments. The problem is now, that I don't know how to distribute it.

The modification makes changes to the ticket-system and is delivered with a plugin which checks the permissions of the requesting user.

The question I have now: Could you integrate the modification into trac? Or should I make a Trac Hacks page with a notice that the modifcation changes the core-files?

Looking forward to hearing from you,

Michael

Attachments (1)

groupcomments.zip (5.1 KB ) - added by michael.henke@… 14 years ago.
the plugin, a patchfile and a sql script

Download all attachments as: .zip

Change History (3)

by michael.henke@…, 14 years ago

Attachment: groupcomments.zip added

the plugin, a patchfile and a sql script

comment:1 by Remy Blank, 14 years ago

Resolution: wontfix
Status: newclosed

There are two reasons why I don't want to integrate this patch:

  • It adds a new column to the ticket table. Adding more columns to that table for every new feature makes the code difficult to maintain. If anything, you should consider using a custom ticket field instead, it would probably simplify your code substantially.
  • I'm pretty sure this functionality can be implemented with a stream filter.

Considering this, you should be able to implement the complete functionality in a plugin, without having to patch Trac core. You may find this to be much easier to maintain in the long run, too. And trac-hacks is certainly a good location to host the plugin.

See trunk/tracopt/ticket/deleter.py for an example component that uses a stream filter (ITemplateStreamFilter) to alter the ticket page.

comment:2 by michael.henke@…, 14 years ago

Hi!

On your advice I started to write the modifcation as a Plugin. But now I have a problem with the filter_stream implementation.

First a little bit code:

buffer = StreamBuffer()

def check_comment():
		print buffer
		return buffer

#'//form[@method="get" and @action="#comment" and @class="printableform"]'
html = stream | Transformer('//div[@class="change"]') \
		.copy(buffer,False) \
		.replace(check_comment()).end()
		
		#.select('//div[@class="change"]') \
		#.copy(buffer,True).end() \
		
return html

As you can see I select the ticket changes with the Transformer. In the function check_comment() I want to check if the current user is able to see the comment.

The problem is, that I can't access the buffer in the check_access function. Why can't I access the Streambuffer "buffer" in the check_access() method?

bye, Michael

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.