It would be useful if we could customize the options for the dropdown selections in the advanced search filters. Currently, the options are hard-coded with a large list of options for each dropdown, making it difficult to adjust which options are shown, the way they are ordered, etc.
Created attachment 169448 [details] [review] Bug 37442: Add customizable dropdown selections for the advanced search filters To test: 1) Apply patch, restart_all 2) Visit Tools->HTML customizations 3) Click 'New entry using text editor' 4) For 'Display location', select "StaffAdvancedSearchList" 5) Make the publication date today. 6) For the content, put some dropdown options... you can paste in this block for example: <option value="au">Author</option> <option value="ti">Title</option> <option value="bc">Barcode</option> 7) Visit the Advanced search page 8) In the search dropdowns, notice that there are only the options that you provided (Author, Title, Barcode) 9) In the top search dropdown, select 'Title' and type in "the" 10) Press 'Search'. The search completes succesfully. Now press 'Edit this search' 11) You should be brought back to the 'Advanced search' page and the top dropdown should be selected as 'Title' and have "the" prefilled. 12) In the second search dropdown, select "Author" and type in "John" 13) Now press search. Once again press "Edit this search" and note the items are prefilled correctly. 14) Go back to Tools->HTML customizations and delete the 'StaffAdvancedSearchList' we initially created. 15) Back at the 'Advanced search' page, the dropdown options should be back to the default. Do some searches to ensure the searches work, and when editing, the options are correctly prefilled.
Created attachment 169494 [details] [review] Bug 37442: Add customizable dropdown selections for the advanced search filters To test: 1) Apply patch, restart_all 2) Visit Tools->HTML customizations 3) Click 'New entry using text editor' 4) For 'Display location', select "StaffAdvancedSearchList" 5) Make the publication date today. 6) For the content, put some dropdown options... you can paste in this block for example: <option value="au">Author</option> <option value="ti">Title</option> <option value="bc">Barcode</option> 7) Visit the Advanced search page 8) In the search dropdowns, notice that there are only the options that you provided (Author, Title, Barcode) 9) In the top search dropdown, select 'Title' and type in "the" 10) Press 'Search'. The search completes succesfully. Now press 'Edit this search' 11) You should be brought back to the 'Advanced search' page and the top dropdown should be selected as 'Title' and have "the" prefilled. 12) In the second search dropdown, select "Author" and type in "John" 13) Now press search. Once again press "Edit this search" and note the items are prefilled correctly. 14) Go back to Tools->HTML customizations and delete the 'StaffAdvancedSearchList' we initially created. 15) Back at the 'Advanced search' page, the dropdown options should be back to the default. Do some searches to ensure the searches work, and when editing, the options are correctly prefilled. Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
If I see it correctly in the code, this patch breaks the *NumbersPreferPhrase system preferences behavior. Can you please check?