We can use the same modal-style selection process for choosing columns to be included in OPACSuggestionUnwantedFields and OPACSuggestionMandatoryFields.
Created attachment 114979 [details] [review] Bug 26296: Use new table column selection modal for OPAC suggestion fields This patch builds on the change introduced by Bug 22844, changing the selection mode for the OPACSuggestionMandatoryFields and OPACSuggestionUnwantedFields preferences to a modal. This patch includes a database update for converting the format of the saved values in these preferences. Previously the suggestions table fields would be separated by a comma. Now they should be separated by a pipe. To test, apply the patch run the database update. - Go to Administration -> System preferences. - Search for 'OPACSuggestion.' - The input fields for OPACSuggestionUnwantedFields and OPACSuggestionMandatoryFields should appear as "locked" (read-only) inputs. - Clicking either input field should trigger a modal window with checkboxes for each available column in the suggestions table. - Test that the "select all" and "clear all" links work correctly. - Test that the "cancel" link closes the modal without saving your selections. - Test that the "Save" button closes the modal, copies your selections to the form field, and triggers the preference-saving function. - Test that changes to both preferences are correctly reflected in the OPAC suggestion form.
Owen, In testing this I found something wrong with OPACSuggestionMandatoryFields. I have: -applied the patch -updatedatabase (a few times) -by default title is set as required on /cgi-bin/koha/opac-suggestions.pl -in OPACSuggestionMandatoryFields I set something othen than title to mandatory. -title then becomes NOT required -Since title isn't in the modal for OPACSuggestionMandatoryFields I now have no way of making it required.
(In reply to Lucas Gass from comment #2) > Owen, > > In testing this I found something wrong with OPACSuggestionMandatoryFields. > > I have: > > -applied the patch > -updatedatabase (a few times) > -by default title is set as required on /cgi-bin/koha/opac-suggestions.pl > -in OPACSuggestionMandatoryFields I set something othen than title to > mandatory. > -title then becomes NOT required > -Since title isn't in the modal for OPACSuggestionMandatoryFields I now have > no way of making it required. I noticed the same problems Lucas described. I add that required field are not anymore displayed in red.
Oups, wrong status...
Created attachment 127457 [details] [review] Bug 26296: (follow-up) Make sure title remains mandatory This patch adds a flag to the OPAC preferences file marking suggestion title as mandatory OPACSuggestionMandatoryFields and excluded from OPACSuggestionUnwantedFields. The patch also modifies the markup around required fields in the OPAC suggestion form to comply with changes made in Bug 27668 to mandatory field styling. To test, apply the patch and restart services. - Test the OPACSuggestionMandatoryFields preference. In the modal, "title" should be checked and the label in red. It should not be possible to uncheck the checkbox. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are still saved correctly. - Test the OPACSuggestionUnwantedFields preference. In the modal, "title" should be unchecked and disabled. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are saved correctly.
Patch no longer applies 8-(... Applying: Bug 26296: Use new table column selection modal for OPAC suggestion fields error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref). error: could not build fake ancestor Patch failed at 0001 Bug 26296: Use new table column selection modal for OPAC suggestion fields
Created attachment 128132 [details] [review] Bug 26296: Use new table column selection modal for OPAC suggestion fields This patch builds on the change introduced by Bug 22844, changing the selection mode for the OPACSuggestionMandatoryFields and OPACSuggestionUnwantedFields preferences to a modal. This patch includes a database update for converting the format of the saved values in these preferences. Previously the suggestions table fields would be separated by a comma. Now they should be separated by a pipe. To test, apply the patch run the database update. - Go to Administration -> System preferences. - Search for 'OPACSuggestion.' - The input fields for OPACSuggestionUnwantedFields and OPACSuggestionMandatoryFields should appear as "locked" (read-only) inputs. - Clicking either input field should trigger a modal window with checkboxes for each available column in the suggestions table. - Test that the "select all" and "clear all" links work correctly. - Test that the "cancel" link closes the modal without saving your selections. - Test that the "Save" button closes the modal, copies your selections to the form field, and triggers the preference-saving function. - Test that changes to both preferences are correctly reflected in the OPAC suggestion form.
Created attachment 128133 [details] [review] Bug 26296: (follow-up) Make sure title remains mandatory This patch adds a flag to the OPAC preferences file marking suggestion title as mandatory OPACSuggestionMandatoryFields and excluded from OPACSuggestionUnwantedFields. The patch also modifies the markup around required fields in the OPAC suggestion form to comply with changes made in Bug 27668 to mandatory field styling. To test, apply the patch and restart services. - Test the OPACSuggestionMandatoryFields preference. In the modal, "title" should be checked and the label in red. It should not be possible to uncheck the checkbox. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are still saved correctly. - Test the OPACSuggestionUnwantedFields preference. In the modal, "title" should be unchecked and disabled. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are saved correctly.
Created attachment 128141 [details] [review] Bug 26296: (follow-up) Make sure title remains mandatory This patch adds a flag to the OPAC preferences file marking suggestion title as mandatory OPACSuggestionMandatoryFields and excluded from OPACSuggestionUnwantedFields. The patch also modifies the markup around required fields in the OPAC suggestion form to comply with changes made in Bug 27668 to mandatory field styling. To test, apply the patch and restart services. - Test the OPACSuggestionMandatoryFields preference. In the modal, "title" should be checked and the label in red. It should not be possible to uncheck the checkbox. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are still saved correctly. - Test the OPACSuggestionUnwantedFields preference. In the modal, "title" should be unchecked and disabled. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are saved correctly. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 128142 [details] [review] Bug 26296: Use new table column selection modal for OPAC suggestion fields This patch builds on the change introduced by Bug 22844, changing the selection mode for the OPACSuggestionMandatoryFields and OPACSuggestionUnwantedFields preferences to a modal. This patch includes a database update for converting the format of the saved values in these preferences. Previously the suggestions table fields would be separated by a comma. Now they should be separated by a pipe. To test, apply the patch run the database update. - Go to Administration -> System preferences. - Search for 'OPACSuggestion.' - The input fields for OPACSuggestionUnwantedFields and OPACSuggestionMandatoryFields should appear as "locked" (read-only) inputs. - Clicking either input field should trigger a modal window with checkboxes for each available column in the suggestions table. - Test that the "select all" and "clear all" links work correctly. - Test that the "cancel" link closes the modal without saving your selections. - Test that the "Save" button closes the modal, copies your selections to the form field, and triggers the preference-saving function. - Test that changes to both preferences are correctly reflected in the OPAC suggestion form. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 128143 [details] [review] Bug 26296: (follow-up) Make sure title remains mandatory This patch adds a flag to the OPAC preferences file marking suggestion title as mandatory OPACSuggestionMandatoryFields and excluded from OPACSuggestionUnwantedFields. The patch also modifies the markup around required fields in the OPAC suggestion form to comply with changes made in Bug 27668 to mandatory field styling. To test, apply the patch and restart services. - Test the OPACSuggestionMandatoryFields preference. In the modal, "title" should be checked and the label in red. It should not be possible to uncheck the checkbox. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are still saved correctly. - Test the OPACSuggestionUnwantedFields preference. In the modal, "title" should be unchecked and disabled. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are saved correctly. Signed-off-by: David Nind <david@davidnind.com>
We are loosing the ability to translate syspref's values, is that expected?
I am not sure if .json is parsed by the translation tools, but maybe introducing HTML tags would be worth trying? For the borrowers prefs we use the database column names, so translations weren't needed, but it would be nice if we could make it possible in this case.
I am going to work on the translatability problem on a separate bug report.
(In reply to Jonathan Druart from comment #14) > I am going to work on the translatability problem on a separate bug report. I've opened bug 29695.
Created attachment 128538 [details] [review] Bug 26296: Use new table column selection modal for OPAC suggestion fields This patch builds on the change introduced by Bug 22844, changing the selection mode for the OPACSuggestionMandatoryFields and OPACSuggestionUnwantedFields preferences to a modal. This patch includes a database update for converting the format of the saved values in these preferences. Previously the suggestions table fields would be separated by a comma. Now they should be separated by a pipe. To test, apply the patch run the database update. - Go to Administration -> System preferences. - Search for 'OPACSuggestion.' - The input fields for OPACSuggestionUnwantedFields and OPACSuggestionMandatoryFields should appear as "locked" (read-only) inputs. - Clicking either input field should trigger a modal window with checkboxes for each available column in the suggestions table. - Test that the "select all" and "clear all" links work correctly. - Test that the "cancel" link closes the modal without saving your selections. - Test that the "Save" button closes the modal, copies your selections to the form field, and triggers the preference-saving function. - Test that changes to both preferences are correctly reflected in the OPAC suggestion form. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 128539 [details] [review] Bug 26296: (follow-up) Make sure title remains mandatory This patch adds a flag to the OPAC preferences file marking suggestion title as mandatory OPACSuggestionMandatoryFields and excluded from OPACSuggestionUnwantedFields. The patch also modifies the markup around required fields in the OPAC suggestion form to comply with changes made in Bug 27668 to mandatory field styling. To test, apply the patch and restart services. - Test the OPACSuggestionMandatoryFields preference. In the modal, "title" should be checked and the label in red. It should not be possible to uncheck the checkbox. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are still saved correctly. - Test the OPACSuggestionUnwantedFields preference. In the modal, "title" should be unchecked and disabled. - Test that the "Select all" and "Clear all" links don't affect the "title" checkbox. - Confirm that your selections are saved correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I would suggest to push this one along with bug 29695, to note lose the translatability.
Ah atomic update script needs to be updated to match new DBRev system.
(In reply to Fridolin Somers from comment #19) > Ah atomic update script needs to be updated to match new DBRev system.
(In reply to Fridolin Somers from comment #20) > (In reply to Fridolin Somers from comment #19) > > Ah atomic update script needs to be updated to match new DBRev system. So far it was not mandatory, maybe we should add to coding guidelines/communicate - we have a lot of old database updates out there. :)
(In reply to Katrin Fischer from comment #21) > (In reply to Fridolin Somers from comment #20) > > (In reply to Fridolin Somers from comment #19) > > > Ah atomic update script needs to be updated to match new DBRev system. > > So far it was not mandatory, maybe we should add to coding > guidelines/communicate - we have a lot of old database updates out there. :) Ah I see its is described in : https://wiki.koha-community.org/wiki/Database_updates I understand it is mandatory.
Yes, but we didn't point it out in QA for old patches, only for new ones. I'll add a note to the next QA email.
I volunteered at the time to adjust before push, I was RM. I can help if you want, but it's trivial to switch from the old to the new version.
(In reply to Jonathan Druart from comment #24) > I volunteered at the time to adjust before push, I was RM. > I can help if you want, but it's trivial to switch from the old to the new > version. OK I'll do it also. Just wanted a confirmation :)
Pushed to master for 22.05, thanks to everybody involved [U+1F984]