Edgewall Software
Modify

Opened 21 years ago

Closed 20 years ago

Last modified 15 years ago

#222 closed enhancement (fixed)

'Assign to' as popup list

Reported by: anonymous Owned by: Christopher Lenz
Priority: high Milestone: 0.9
Component: ticket system Version: devel
Severity: normal Keywords: users list assignment
Cc: manuzhai@…, dserodio@…, bootsch@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

It would be nice to add developers for 'Assign to' with trac-admin and have them show up in a popup list like the other ticket properties. This would eliminate the possibility of mis-spelled names.

Attachments (4)

trac.ticket.222.diff (5.9 KB ) - added by ivanoe@… 20 years ago.
patch: solution to the ticket using both apache password or trac 'permission' table's 'username'
patch-emailnotify-r1120.diff (13.9 KB ) - added by Christopher Lenz 20 years ago.
Slightly reworked pkou's patch from ticket #1028
trac-users.py (678 bytes ) - added by dserodio@… 19 years ago.
Generates INSERT statements for Trac users in a htdigest file, so they show up in the "owner" drop-down.
trac-users.2.py (678 bytes ) - added by dserodio@… 19 years ago.
Oops, authenticated should be 1, not 0

Download all attachments as: .zip

Change History (38)

comment:1 by anonymous, 21 years ago

…and generally make it easier to set the field.

comment:2 by daniel, 21 years ago

Hmm, maybe it'd be useful to have a popup with 'registered' users and populate the field entirely with javascript… that'd be more flexible than having to duplicate the interface.

comment:3 by daniel, 20 years ago

Having the Session architecture, we could potentially use that data. It might be a too extensive list though.

comment:4 by anonymous, 20 years ago

Version: 0.60.6.1

comment:5 by anonymous, 20 years ago

Version: 0.6.10.6

comment:6 by Christopher Lenz, 20 years ago

#573 has been marked as duplicate of this ticket. See that ticket for further comments.

by ivanoe@…, 20 years ago

Attachment: trac.ticket.222.diff added

patch: solution to the ticket using both apache password or trac 'permission' table's 'username'

comment:7 by ivanoe@…, 20 years ago

Keywords: users list assignment added
Version: 0.6devel

The attachment trac.ticket.222.diff solves the issue in following ways:

  • If the Environment variable TRAC_PWDFILE is defined in the httpd.conf Apache configuration, the list of users is taken from this passwordfile:
    ...
    <Location "/trac">
       SetEnv TRAC_ENV /path/to/trac/project_trac.db
       SetEnv TRAC_PWDFILE "path/to/subversionpassword"
    </Location>
    ...
    

The value of TRAC_PWDFILE should be the same as the one configured for AuthUserFile in section:

...
<Location "/trac/login">
  ...
  AuthUserFile "path/to/subversionpassword"
  ...
</Location>
...
  • Otherwise, the list of users is taken from the 'permission' table in trac.db. Only the end-users are included. The groups as explained in TracPermissions are not returned as is not 'anonymous' user.
  • Empty string is also added to the list.

Please note: I tested only on Windows.

It could be cool if included into 0.8, but I am afraid that might be a bit too late for that…

comment:8 by ivanoe, 20 years ago

dummpy comment as it seems that the last change did not appear in the timeline.

comment:9 by ivanoe, 20 years ago

Milestone: 0.9

please ignore the changes to header.cs in the patch - they are related to the other change

comment:10 by Jonas Borgström, 20 years ago

Milestone: 0.92.0

This is a good idea but unfortunately we don't have way to get a complete list of available users without adding auth-specific code to Trac. I don't even think that's possible with some auth modules.

This will probably have to wait until Trac 2.0 where we will have real user support.

comment:11 by Christopher Lenz, 20 years ago

#876 has been marked as a duplicate of this bug. That ticket also has a patch.

comment:12 by Christopher Lenz, 20 years ago

#1028 has been marked as duplicate of this one. That ticket also has a patch.

comment:13 by Christopher Lenz, 20 years ago

Milestone: 2.00.9
Owner: changed from Jonas Borgström to Christopher Lenz
Priority: normalhigh
Status: newassigned

by Christopher Lenz, 20 years ago

Slightly reworked pkou's patch from ticket #1028

comment:14 by pkou <pkou at ua.fm>, 20 years ago

The updated patch looks OK for me. Thank you for the feedback.

comment:15 by Josh Burley <jburley@…>, 20 years ago

This is working great for me, now. Awesome! This feature has basically gotten Trac accepted here :D (am consulting for a department within a Fortune 100 company).

comment:16 by anonymous, 20 years ago

Cc: manuzhai@… added

comment:17 by Christopher Lenz, 20 years ago

Resolution: fixed
Status: assignedclosed

This has been implemented in [1342]. The part of the patch related to sending ticket notifications to ticket owners will come later… Thanks pkou!

comment:18 by anonymous, 20 years ago

The always_notify_owner option included in the patch will be tracked using #866.

comment:19 by Gunnar Wagenknecht <gunnar@…>, 19 years ago

Cc: gunnar@… added

comment:20 by Gunnar Wagenknecht <gunnar@…>, 19 years ago

Cc: manuzhai@gmail.com,gunnar@wageknecht.org → manuzhai@gmail.com, gunnar@wageknecht.org

comment:21 by dserodio@…, 19 years ago

Cc: dserodio@… added

Where is the list of users is taken from after all? In [1342], I can see a get_known_users method which queries

SELECT DISTINCT s.username, n.var_value, e.var_value 
FROM session AS s 
LEFT JOIN session AS n ON (n.sid IS NULL 
 AND n.username=s.username AND n.var_name = 'name') 
LEFT JOIN session AS e ON (e.sid IS NULL 
 AND e.username=s.username AND e.var_name = 'email') 
WHERE s.sid IS NULL ORDER BY s.username

But if I run this query on the SQLite prompt, I get:

SQL error: no such column: s.username

comment:22 by anonymous, 19 years ago

Adding dummy comment because the previous one didn't make it to the Timeline

comment:23 by Christopher Lenz, 19 years ago

Look at the current version of get_known_users() in trac.env.

Anyway, to answer your question, the set of user names is retrieved from the session table, which should contain all the users that ever logged in.

comment:24 by dserodio@…, 19 years ago

Thanks, now I achieved what I wanted: to "pre-fill" the set of user names with users that have never logged in.

See attached trac-users.py utility script that generates the INSERT statements for users contained in a htdigest or htpasswd files.

by dserodio@…, 19 years ago

Attachment: trac-users.py added

Generates INSERT statements for Trac users in a htdigest file, so they show up in the "owner" drop-down.

by dserodio@…, 19 years ago

Attachment: trac-users.2.py added

Oops, authenticated should be 1, not 0

comment:25 by bootsch, 19 years ago

Cc: bootsch@… added

Did someone create a patch for use with version 0.9.x? The provided patches work on 0.8.x correct?

I really like the feature ;-) but had to move to 0.9 ;-(

comment:26 by anonymous, 19 years ago

Did you not see that this is now part of the core Trac? It was done in [1342] and is documented in TracIni. Look for restrict_owner.

comment:27 by anonymous, 19 years ago

Oops, I missed that indeed, thank you for pointing that out

comment:28 by mmcneil@…, 19 years ago

How can I delete the username of an old user from this assign-to drop-down list? Is there any way I can edit or pre-populate this list?

comment:29 by Emmanuel Blot, 19 years ago

There is no current way to edit this list, but tweaking the DB (using SQL commands).
Please ask further questions about this topic on the ML.

comment:30 by Emmanuel Blot, 19 years ago

See #1347 for a WebAdmin-based solution.

comment:31 by anonymous, 18 years ago

Cc: gunnar@… removed

comment:32 by landpro, 17 years ago

Hello! Can I use this patch with 10.4 version? If yes then how?

Thank you in advance.

comment:33 by anonymous, 15 years ago

How do you actually turn this on ?

in reply to:  33 comment:34 by mrelbe <mikael@…>, 15 years ago

Replying to anonymous:

How do you actually turn this on ?

The answer is stated in comment:26 above:

…and is documented in TracIni. Look for restrict_owner.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.