We can use Select2 to allow multiple selections of item types and libraries in the bibliographic record export.
Created attachment 180421 [details] [review] Bug 39533: Use select2 to select item types and libraries in biblio export This patch updates the bibliographic export page so that item type and library export use Select2 form fields. This change has the added benefit of enabling the removal of a single-use include, branch-selector.inc. The patch also adds some JavaScript to make sure the "CSV profile" field appears on page load if CSV is selected as the file format. This is helpful if the user has reloaded the page or arrived at the page by using the browser back button. To test, apply the patch and go to Cataloging -> Export catalog data. - Under the "Export bibliographic records" tab you should see two Select2-style form field under the "Select records to export" heading, "Item type" and "Home library." - Confirm that the fields work correctly when adding one or more selections to each. - Confirm that the selections work correctly to filter the export. I recommend using CSV as the file format for the export. A MARC export CSV profile (Tools -> CSV profiles -> New CSV profile) containing these fields will show the relevant information: Title=245$a\|Library=952$a\|Itemtype=952$y - When you select CSV as the file format the "CSV profile" dropdown menu should appear. If you choose a different format, that dropdown should disappear. - With CSV selected as the file format, reload the page. The "CSV profile" field should still be visible. Sponsored-by: Athens County Public Libraries
Created attachment 180477 [details] [review] Bug 39533: Use select2 to select item types and libraries in biblio export This patch updates the bibliographic export page so that item type and library export use Select2 form fields. This change has the added benefit of enabling the removal of a single-use include, branch-selector.inc. The patch also adds some JavaScript to make sure the "CSV profile" field appears on page load if CSV is selected as the file format. This is helpful if the user has reloaded the page or arrived at the page by using the browser back button. To test, apply the patch and go to Cataloging -> Export catalog data. - Under the "Export bibliographic records" tab you should see two Select2-style form field under the "Select records to export" heading, "Item type" and "Home library." - Confirm that the fields work correctly when adding one or more selections to each. - Confirm that the selections work correctly to filter the export. I recommend using CSV as the file format for the export. A MARC export CSV profile (Tools -> CSV profiles -> New CSV profile) containing these fields will show the relevant information: Title=245$a\|Library=952$a\|Itemtype=952$y - When you select CSV as the file format the "CSV profile" dropdown menu should appear. If you choose a different format, that dropdown should disappear. - With CSV selected as the file format, reload the page. The "CSV profile" field should still be visible. Sponsored-by: Athens County Public Libraries
Nice!