@@ -, +, @@ datatables.inc --- .../Bug19368_SortIgnoreArticles.sql | 1 + .../BugUndef-SerialSortIgnoreWords.sql | 1 - installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/includes/datatables.inc | 31 ++++++++++++++++++- .../modules/admin/preferences/searching.pref | 6 +++- .../bootstrap/en/includes/datatables.inc | 5 +-- serials/serials-search.pl | 2 +- 7 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql delete mode 100644 installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql --- a/installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql +++ a/installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql @@ -0,0 +1, @@ +INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SortIgnoreArticles','a an the',NULL,'Articles to ignore in when sorting','Free'); --- a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql +++ a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql @@ -1, +0,0 @@ -INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SerialSortIgnoreWords','',NULL,'Words to ignore in serial search','Free'); --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -604,7 +604,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'), ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'), ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'), -('SerialSortIgnoreWords','',NULL,'Words to ignore in serial search','Free'), ('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'), ('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'), ('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'), @@ -621,6 +620,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'), ('SMSSendUsername', '', '', 'Username/Login used to send SMS messages', 'free'), ('SocialNetworks','0','','Enable/Disable social networks links in opac detail pages','YesNo'), +('SortIgnoreArticles','',NULL,'Words to ignore in serial search','Free'), ('SpecifyDueDate','1','','Define whether to display \"Specify Due Date\" form in Circulation','YesNo'), ('SpecifyReturnDate',1,'','Define whether to display \"Specify Return Date\" form in Circulation','YesNo'), ('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc @@ -1,5 +1,34 @@ -[% USE raw %] +[% USE Koha %] [% USE Asset %] [% INCLUDE 'format_price.inc' %] [% Asset.js("lib/datatables/datatables.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/jquery.dataTables.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/dataTables.buttons.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/buttons.colVis.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/jszip.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/buttons.print.min.js") | $raw %] +[% Asset.js("lib/jquery/plugins/buttons.html5.min.js") | $raw %] + [% Asset.js("js/datatables.js") | $raw %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -87,7 +87,11 @@ Searching: 0: Disable - "the cross_fields option for Elasticsearch searches, supported in Elasticsearch 6.X and above." - "See documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-cross-fields" - Search form: + - + - 'Ignore the following words when sorting the serial search result table (separate words with spaces) :' + - pref: SortIgnoreArticles + class: free + Search Form: - - pref : LoadSearchHistoryToTheFirstLoggedUser default: 0 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc @@ -21,6 +21,7 @@ var MSG_DT_COPIED_ONE_ROW = _("Copied one row to clipboard"); var MSG_CLEAR_FILTER = _("Clear filter"); var MSG_DT_ALL = _("All"); - var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the"); + var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = "[% Koha.Preference('SortIgnoreArticles') %]"; +//]]> -[% Asset.js("js/datatables.js") | $raw %] +[% Asset.js("js/datatables.js") %] --- a/serials/serials-search.pl +++ a/serials/serials-search.pl @@ -154,7 +154,7 @@ else } #sort stopword by string length -my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SerialSortIgnoreWords")); +my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SortIgnoreArticles")); my $subsctitle; my (@openedsubscriptions, @closedsubscriptions); for my $sub ( @subscriptions ) { --