Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#5394 closed defect (fixed)

Order user list alphabetically

Reported by: dharris <dharris+trac@…> Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: ticket system Version:
Severity: normal Keywords: ticket sort
Cc: r.sokoll@…, Eli Carter Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In trac.ini, I have restrict_owner = true set so that my users are listed in the "assign to" and "reassign to" fields. But they are shown in a seemingly random order.

I'm attaching a patch to ticket/api.py which sorts the user by username (case-insensitive).

Attachments (1)

api.py.diff (446 bytes ) - added by dharris <dharris+trac@…> 17 years ago.
patch for ticket/api.py to sort user names

Download all attachments as: .zip

Change History (7)

by dharris <dharris+trac@…>, 17 years ago

Attachment: api.py.diff added

patch for ticket/api.py to sort user names

comment:1 by Christian Boos, 17 years ago

Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos

I'll integrate that in FieldRefactoring first.

comment:2 by dharris <dharris+trac@…>, 17 years ago

The patch I submitted only applies to the dropdown list for initial ticket assignment. The code for generating the list for reassigning a ticket is separate.

Thus there are a few different options here:

  1. Duplicate the code from the patch I submitted in the render_ticket_action_control method in ConfigurableTicketWorkflow (ticket/default_workflow.py)
  2. Modify perm.get_users_with_permission to accept an optional keyword parameter. Something like: owners = perm.get_users_with_permission('TICKET_MODIFY', sorted=True)
  3. Consolidate the code for getting lists for assign and reassign to one method.

Options 2 and 3 are not mutually exclusive.

comment:3 by r.sokoll@…, 17 years ago

Cc: r.sokoll@… added
Milestone: 0.11.10.11
Type: enhancementdefect

Since this is working as expected in the 0.10 branch, it is more a bug than an enhacement.

comment:4 by Christian Boos, 17 years ago

Resolution: fixed
Status: newclosed

Fixed in r5858. The fix had to be done in default_workflow.py rather than api.py.

comment:5 by Eli Carter, 17 years ago

Cc: Eli Carter added
Resolution: fixed
Status: closedreopened

This fixed the list in the actions, but the list on the 'new ticket' page is still random.

comment:6 by Eli Carter, 17 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in r5897

Modify Ticket

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