From 6ad77a9c45d06be293fe7cee4ae7f5aaf5e7d16e Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Wed, 4 Oct 2017 13:57:20 -0400 Subject: [PATCH] Bug 19368 - Syspref now "SortIgnoreArticles", used in datatables.inc --- installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql | 1 + installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql | 1 - installer/data/mysql/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc | 3 ++- .../intranet-tmpl/prog/en/modules/admin/preferences/searching.pref | 5 +++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc | 3 ++- serials/serials-search.pl | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql delete mode 100644 installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql diff --git a/installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql b/installer/data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql new file mode 100644 index 0000000..dda42f5 --- /dev/null +++ b/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'); \ No newline at end of file diff --git a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql b/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql deleted file mode 100644 index 893b943..0000000 --- a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SerialSortIgnoreWords','',NULL,'Words to ignore in serial search','Free'); \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 2a0e8e3..ba376a6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -485,7 +485,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'), ('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'), @@ -500,6 +499,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'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc index 72be3f1..630bac2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc @@ -1,3 +1,4 @@ +[% USE Koha %] [% INCLUDE 'format_price.inc' %] @@ -19,7 +20,7 @@ var MSG_DT_SEARCH = _("Search:"); var MSG_DT_ZERO_RECORDS = _("No matching records found"); var MSG_DT_ALL = _("All"); - var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the"); + var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = "[% Koha.Preference('SortIgnoreArticles') %]"; //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 0178468..17a0f2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -78,6 +78,11 @@ Searching: yes: Keep no: "Don't keep" - patron search history in the staff client. + - + - 'Ignore the following words when sorting the serial search result table (separate words with spaces) :' + - pref: SortIgnoreArticles + class: free + - Search Form: - - Load the unlogged history to the next user. diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc index d3075c9..cb98fdc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc @@ -1,3 +1,4 @@ +[% USE Koha %] \ No newline at end of file diff --git a/serials/serials-search.pl b/serials/serials-search.pl index 24bcbe6..fd30557 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -123,7 +123,7 @@ if ($routing) { } #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 ) { -- 2.7.4