From 9499bc9ee71ae5f29df4affe6a04c48e1a9e2c4b Mon Sep 17 00:00:00 2001 From: Charles Farmer Date: Mon, 16 Apr 2018 15:37:58 -0400 Subject: [PATCH] Bug 19368 - Syspref now SortIgnoreArticles, used in datatables.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE --- .../data/mysql/atomicupdate/Bug19368_SortIgnoreArticles.sql | 1 + .../mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql | 1 - installer/data/mysql/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc | 4 ++-- .../prog/en/modules/admin/preferences/searching.pref | 6 +++++- koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc | 4 ++-- serials/serials-search.pl | 2 +- 7 files changed, 12 insertions(+), 8 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 0000000000..40485b8e14 --- /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'); diff --git a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql b/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql deleted file mode 100644 index 893b943226..0000000000 --- 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 ddb2bc664f..c6bf51da65 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -542,7 +542,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'), @@ -558,6 +557,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 eda776e03c..28ce83114f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc @@ -1,4 +1,4 @@ -[% USE raw %] +[% USE Koha %] [% USE Asset %] [% INCLUDE 'format_price.inc' %] [% Asset.js("lib/jquery/plugins/jquery.dataTables.min.js") | $raw %] @@ -23,7 +23,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') %]"; var MSG_DT_COPY_TITLE = _("Copy to clipboard"); var MSG_DT_COPY_KEYS = _("Press ctrl or ⌘ + C to copy the table data
to your system clipboard.

To cancel, click this message or press escape."); var MSG_DT_COPY_SUCCESS_ONE = _("Copied one row to clipboard"); 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 f1b87d89c9..c9a4d3a4b7 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 @@ -84,7 +84,11 @@ Searching: choices: yes: Enable no: Disable - - "browsing search results from the bibliographic record detail page in staff client." + - "browsing search results fromt the bibliographic record detail page in 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 d711ee5bfa..e72fac83b3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc @@ -16,7 +16,7 @@ var MSG_DT_PROCESSING = _("Processing..."); var MSG_DT_SEARCH = _("Search:"); var MSG_DT_ZERO_RECORDS = _("No matching records found"); - 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") %] diff --git a/serials/serials-search.pl b/serials/serials-search.pl index 495a98893c..7117afa82a 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -159,7 +159,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 ) { -- 2.17.1