#11573 closed enhancement (fixed)
Show projects as dropdown in custom query form
Reported by: | endquote | Owned by: | falkb |
---|---|---|---|
Priority: | normal | Component: | SimpleMultiProjectPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
On the custom query form, if you filter on a project, the filter rule is a text-entry field. It would be nice if that were a dropdown list of open projects.
Attachments (1)
Change History (15)
comment:1 Changed 10 years ago by
Changed 10 years ago by
Attachment: | SimpleMultiProject_plugin_11573.patch added |
---|
Patch to use 'select' ticket custom field instead of 'text' for project information
comment:2 Changed 10 years ago by
Seems to be an awesome fix!! Gonna hurry up to test it soon... stay tuned, Cheers, F@lk
comment:3 Changed 10 years ago by
Status: | new → accepted |
---|
comment:5 follow-up: 8 Changed 10 years ago by
Works well here, too. Even still if not set to 'select' type.
BTW: Cinc, do you see how to get an alphabetically ordered list of versions in a custom-query?
comment:6 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I found one annoyance with multi environment installations.
Please remove the lines
Option("ticket-custom", "project", "select", doc="Ticket custom field needed for SimpleMultiProject plugin. This must be of type select.") Option("ticket-custom", "project.label", "Project", doc="Label for ticket custom field used by SimpleMultiProject plugin.")
from ticket.py.
Otherwise the ticket custom field will be added to trac environments even if the plugin is disabled.
comment:8 follow-up: 9 Changed 10 years ago by
Replying to falkb:
Works well here, too. Even still if not set to 'select' type.
BTW: Cinc, do you see how to get an alphabetically ordered list of versions in a custom-query?
You mean in a drop down list or in the ticket table?
/me confused
comment:9 Changed 10 years ago by
Replying to anonymous:
You mean in a drop down list or in the ticket table?
The drop down list of the common 'version' field, seems not to be ordered here, alphabetically
comment:11 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Cinc, it seems to me an ordered version list in the dropdown box on the custom query form is out of reach for this plugin, right? Any idea?
comment:12 follow-up: 13 Changed 10 years ago by
This is great, thanks. I updated the plugin from source before realizing that I just needed to change php.ini. Seems to work ok.
For me the project list is sorted alphabetically, but all items with lowercase titles appear after all items with uppercase titles.
comment:13 Changed 10 years ago by
Replying to endquote:
This is great, thanks. I updated the plugin from source before realizing that I just needed to change php.ini. Seems to work ok.
For me the project list is sorted alphabetically, but all items with lowercase titles appear after all items with uppercase titles.
Hi endquote, does this work for you sufficiently?:
-
simplemultiprojectplugin/trunk/simplemultiproject/model.py
479 479 p.id_project = m.id_project""" 480 480 481 481 cursor.execute(query, [project]) 482 return sorted(cursor.fetchall() )482 return sorted(cursor.fetchall(), key=lambda t: t[0].lower()) 483 483 484 484 def get_versions_for_projectid(self,projectid): 485 485 if VERSION < '0.12':
comment:14 Changed 10 years ago by
I'm not super worried about it... but after applying this patch, the sort seems the same to me. Screenshot: https://www.dropbox.com/s/o6npf6iche8velg/Screenshot%202014-12-23%2011.20.04.png
I created a patch to use a 'select' field instead of a 'text' for the ticket custom field. This way a drop down list is automatically used on the query page. The items for the select field are taken from the db and kept internally. No need to add them to trac.ini.
This works ok for me so far. For current installations just change the definition for the field from 'text' to 'select' in trac.ini and you are set. No need for database changes and stuff. You may reverse the change at any time because there is just text saved in the database but no information about the field type used to gather the text.
The patch is against sources with patch for #12113 applied.