View | Details | Raw Unified | Return to bug 19368
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/BugUndef-SerialSortIgnoreWords.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('SerialSortIgnoreWords','',NULL,'Words to ignore in serial search','Free');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 485-490 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
485
('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
485
('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
486
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
486
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
487
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
487
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
488
('SerialSortIgnoreWords','des du de la le les leur d l an a the',NULL,'Words to ignore in serial search','Free'),
488
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
489
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
489
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
490
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
490
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
491
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref (+5 lines)
Lines 56-58 Serials: Link Here
56
            yes: Make
56
            yes: Make
57
            no: Do not make
57
            no: Do not make
58
        - previous serial automatically available when receiving a new serial issue. The previous issue can also be set to another item type when receiving a new one. Please note that the item-level_itypes syspref must be set to specific item.
58
        - previous serial automatically available when receiving a new serial issue. The previous issue can also be set to another item type when receiving a new one. Please note that the item-level_itypes syspref must be set to specific item.
59
    -
60
        - 'Ignore the following words when sorting the serial search result table (separate words with spaces) :'
61
        - pref: SerialSortIgnoreWords
62
          class: free
63
    -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-1 / +38 lines)
Lines 6-11 Link Here
6
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
6
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
11
//<![CDATA[
12
 $(document).ready(function() {
13
    var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
14
        "sPaginationType": "four_button",
15
        "aoColumnDefs": [
16
            { 'visible' : false, "targets" : 0},
17
            { "iDataSort" : 0, 'aTargets' : [ 2 ] },
18
            { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
19
            { "sType": "title-string", "aTargets" : [ "title-string" ] },
20
            { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
21
        ]
22
    } ) );
23
24
    var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
25
        // FIXME sort function of additional_fields!
26
        "sPaginationType": "four_button",
27
        "aoColumnDefs": [
28
            { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
29
            { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
30
        ]
31
    } ) );
32
33
    osrlt.fnAddFilters("dt-filter", 750);
34
    csrlt.fnAddFilters("dt-filter", 750);
35
36
    $('#serialstabs').tabs();
37
    $("#reopensub").click(function(){
38
      return confirm(_("Are you sure you want to reopen this subscription?"));
39
    });
40
 });
41
  $
42
 //]]>
43
</script>
9
<style type="text/css">input.dt-filter { width : 100%; font-size : 85%; }</style>
44
<style type="text/css">input.dt-filter { width : 100%; font-size : 85%; }</style>
10
</head>
45
</head>
11
46
Lines 111-116 Link Here
111
                <table id="osrlt">
146
                <table id="osrlt">
112
                  <thead>
147
                  <thead>
113
                    <tr>
148
                    <tr>
149
                        <th>Sort</th>
114
                        <th>ISSN</th>
150
                        <th>ISSN</th>
115
                        <th class="anti-the">Title</th>
151
                        <th class="anti-the">Title</th>
116
                        <th>Notes</th>
152
                        <th>Notes</th>
Lines 136-148 Link Here
136
                      [% FOR field IN additional_fields_for_subscription %]
172
                      [% FOR field IN additional_fields_for_subscription %]
137
                        <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td>
173
                        <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td>
138
                      [% END %]
174
                      [% END %]
139
                      <td></td>
175
                      <td colspan="2"></td>
140
                    </tr>
176
                    </tr>
141
                  </tfoot>
177
                  </tfoot>
142
                  <tbody>
178
                  <tbody>
143
                    [% FOREACH subscription IN openedsubscriptions %]
179
                    [% FOREACH subscription IN openedsubscriptions %]
144
                    [% UNLESS subscription.cannotdisplay %]
180
                    [% UNLESS subscription.cannotdisplay %]
145
                      <tr>
181
                      <tr>
182
                        <td>[% IF ( subscription.titlesort ) %][% subscription.titlesort %][% END %]</td>
146
                        <td>
183
                        <td>
147
                        [% IF ( subscription.issn ) %][% subscription.issn %]
184
                        [% IF ( subscription.issn ) %][% subscription.issn %]
148
                        [% END %]
185
                        [% END %]
(-)a/serials/serials-search.pl (-4 / +24 lines)
Lines 37-42 use C4::Output; Link Here
37
use C4::Serials;
37
use C4::Serials;
38
use Koha::AdditionalField;
38
use Koha::AdditionalField;
39
39
40
use Encode;
41
use Unicode::Normalize;
42
40
use Koha::DateUtils;
43
use Koha::DateUtils;
41
44
42
my $query         = new CGI;
45
my $query         = new CGI;
Lines 119-129 if ($routing) { Link Here
119
    }
122
    }
120
}
123
}
121
124
125
#sort stopword by  string length
126
my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SerialSortIgnoreWords"));
127
my $subsctitle;
122
my (@openedsubscriptions, @closedsubscriptions);
128
my (@openedsubscriptions, @closedsubscriptions);
123
for my $sub ( @subscriptions ) {
129
for my $sub ( @subscriptions ) {
124
    unless ( $sub->{closed} ) {
130
    $subsctitle = $sub->{title} ? ucfirst($sub->{title}): '' ;
125
        push @openedsubscriptions, $sub
131
    if ($subsctitle){
126
            unless $sub->{cannotdisplay};
132
        $subsctitle = NFKD($subsctitle);
133
        $subsctitle =~ s/\p{NonspacingMark}//g;
134
        foreach my $stop (@sortedstopword){
135
            my $ucfirststop = ucfirst($stop);
136
            $subsctitle =~ s/$ucfirststop'//;
137
            $subsctitle =~ s/$ucfirststop //;
138
        }
139
    }
140
    $subsctitle =~ s/^\s+//;
141
    $sub->{titlesort} = ucfirst($subsctitle);
142
143
    warn $subsctitle;
144
145
     unless ( $sub->{closed} ) {
146
         push @openedsubscriptions, $sub
147
             unless $sub->{cannotdisplay};
127
    } else {
148
    } else {
128
        push @closedsubscriptions, $sub
149
        push @closedsubscriptions, $sub
129
            unless $sub->{cannotdisplay};
150
            unless $sub->{cannotdisplay};
130
- 

Return to bug 19368