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/mandatory/sysprefs.sql (+1 lines)
Lines 604-609 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
604
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
604
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
605
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
605
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
606
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
606
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
607
('SerialSortIgnoreWords','des du de la le les leur d l an a the',NULL,'Words to ignore in serial search','Free'),
607
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
608
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
608
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
609
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
609
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
610
('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 62-64 Serials: Link Here
62
            1: Do
62
            1: Do
63
            0: Don't
63
            0: Don't
64
        - prefill the notes from the last 'Arrived' serial when generating the next 'Expected' issue.
64
        - prefill the notes from the last 'Arrived' serial when generating the next 'Expected' issue.
65
    -
66
        - 'Ignore the following words when sorting the serial search result table (separate words with spaces) :'
67
        - pref: SerialSortIgnoreWords
68
          class: free
69
    -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-1 / +116 lines)
Lines 307-313 Link Here
307
            [% ELSE %]
307
            [% ELSE %]
308
            <div id="opened">
308
            <div id="opened">
309
              [% IF openedsubscriptions %]
309
              [% IF openedsubscriptions %]
310
                  [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
310
                <table id="osrlt">
311
                  <thead>
312
                    <tr>
313
                        <th>Sort</th>
314
                        <th>ISSN</th>
315
                        <th class="anti-the">Title</th>
316
                        <th>Notes</th>
317
                        <th>Library</th>
318
                        <th>Location</th>
319
                        <th>Call number</th>
320
                        <th class="title-string">Expiration date</th>
321
                        [% FOR field IN additional_fields_for_subscription %]
322
                          <th>[% field.name %]</th>
323
                        [% END %]
324
                        <th class="NoSort">Actions</th>
325
                    </tr>
326
                  </thead>
327
                  <tfoot>
328
                    <tr>
329
                      <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td>
330
                      <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td>
331
                      <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td>
332
                      <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td>
333
                      <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td>
334
                      <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td>
335
                      <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td>
336
                      [% FOR field IN additional_fields_for_subscription %]
337
                        <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td>
338
                      [% END %]
339
                      <td colspan="2"></td>
340
                    </tr>
341
                  </tfoot>
342
                  <tbody>
343
                    [% FOREACH subscription IN openedsubscriptions %]
344
                    [% UNLESS subscription.cannotdisplay %]
345
                      <tr>
346
                        <td>[% IF ( subscription.titlesort ) %][% subscription.titlesort %][% END %]</td>
347
                        <td>
348
                        [% IF ( subscription.issn ) %][% subscription.issn %]
349
                        [% END %]
350
                        </td>
351
                        <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
352
                        </td>
353
                        <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %]
354
                        [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
355
                        </td>
356
                        <td>
357
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
358
                        </td>
359
                        <td>
360
                          [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
361
                        </td>
362
                        <td>
363
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
364
                        </td>
365
                        <td>
366
                            [% IF ( subscription.enddate ) %]
367
                                <span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span>
368
                            [% ELSE %]
369
                                <span title="0000-00-00"></span>
370
                            [% END %]
371
                        </td>
372
373
                        [% FOR field IN additional_fields_for_subscription %]
374
                          [% IF field.authorised_value_category %]
375
                            <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td>
376
                          [% ELSE %]
377
                            <td>[% subscription.additional_fields.${field.name} %]</td>
378
                          [% END %]
379
                        [% END %]
380
381
                        <td>
382
                            <div class="dropdown">
383
                                <div class="btn-group">
384
                                    [% IF ( CAN_user_serials_receive_serials ) %]
385
                                        [%# There should be no space between these two buttons, it would render badly %]
386
                                        <a class="btn btn-default btn-xs" role="button"
387
                                           href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7"><i
388
                                           class="fa fa-inbox"></i> Serial receive</a><a
389
                                           class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button"
390
                                           data-toggle="dropdown" href="#"><b class="caret"></b></a>
391
                                    [% ELSE %]
392
                                        <a class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#">Actions <b class="caret"></b></a>
393
                                    [% END %]
394
                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid %]">
395
396
                                    [% IF ( routing && CAN_user_serials_routing ) %]
397
                                        [% IF ( subscription.cannotedit ) %]
398
                                        [% ELSE %]
399
                                            [% IF ( subscription.routingedit ) %]
400
                                                <li>
401
                                                    <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit %])</a>
402
                                                </li>
403
                                            [% ELSE %]
404
                                                <li>
405
                                                    <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new"> <i class="fa fa-plus"></i> New routing list</a>
406
                                                </li>
407
                                            [% END %]
408
                                        [% END %]
409
                                    [% END # IF ( routing && CAN_user_serials_routing ) %]
410
411
                                    <li>
412
                                        <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a>
413
                                    </li>
414
                                </ul>
415
                                </div>
416
                            </div>
417
                        </td>
418
419
                      </tr>
420
                      [% END %]
421
                    [% END %]
422
                  </tbody>
423
                </table>
311
              [% ELSE %]
424
              [% ELSE %]
312
                <div class="dialog message">
425
                <div class="dialog message">
313
                  <p>Your search returned no open subscriptions.</p>
426
                  <p>Your search returned no open subscriptions.</p>
Lines 462-467 Link Here
462
                "sPaginationType": "full",
575
                "sPaginationType": "full",
463
                "order": [[ 2, "asc" ]],
576
                "order": [[ 2, "asc" ]],
464
                "aoColumnDefs": [
577
                "aoColumnDefs": [
578
                    { 'visible' : false, "targets" : 0},
579
                    { "iDataSort" : 0, 'aTargets' : [ 2 ] },
465
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
580
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
466
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
581
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
467
                ]
582
                ]
(-)a/serials/serials-search.pl (-10 / +27 lines)
Lines 35-42 use C4::Context; Link Here
35
use C4::Output qw( output_html_with_http_headers );
35
use C4::Output qw( output_html_with_http_headers );
36
use C4::Serials qw( CloseSubscription ReopenSubscription SearchSubscriptions check_routing );
36
use C4::Serials qw( CloseSubscription ReopenSubscription SearchSubscriptions check_routing );
37
use Koha::AdditionalFields;
37
use Koha::AdditionalFields;
38
39
use Koha::DateUtils qw( dt_from_string );
38
use Koha::DateUtils qw( dt_from_string );
39
use Encode;
40
use Unicode::Normalize;
40
use Koha::SharedContent;
41
use Koha::SharedContent;
41
42
42
my $query         = CGI->new;
43
my $query         = CGI->new;
Lines 152-167 else Link Here
152
        }
153
        }
153
    }
154
    }
154
155
155
    my (@openedsubscriptions, @closedsubscriptions);
156
#sort stopword by  string length
156
    for my $sub ( @subscriptions ) {
157
my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SerialSortIgnoreWords"));
157
        unless ( $sub->{closed} ) {
158
my $subsctitle;
158
            push @openedsubscriptions, $sub
159
my (@openedsubscriptions, @closedsubscriptions);
159
                unless $sub->{cannotdisplay};
160
for my $sub ( @subscriptions ) {
160
        } else {
161
    $subsctitle = $sub->{title} ? ucfirst($sub->{title}): '' ;
161
            push @closedsubscriptions, $sub
162
    if ($subsctitle){
162
                unless $sub->{cannotdisplay};
163
        $subsctitle = NFKD($subsctitle);
164
        $subsctitle =~ s/\p{NonspacingMark}//g;
165
        foreach my $stop (@sortedstopword){
166
            my $ucfirststop = ucfirst($stop);
167
            $subsctitle =~ s/$ucfirststop'//;
168
            $subsctitle =~ s/$ucfirststop //;
163
        }
169
        }
164
    }
170
    }
171
    $subsctitle =~ s/^\s+//;
172
    $sub->{titlesort} = ucfirst($subsctitle);
173
174
    warn $subsctitle;
175
176
     unless ( $sub->{closed} ) {
177
         push @openedsubscriptions, $sub
178
             unless $sub->{cannotdisplay};
179
    } else {
180
        push @closedsubscriptions, $sub
181
            unless $sub->{cannotdisplay};
182
    }
165
183
166
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
184
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
167
    my @branches_loop;
185
    my @branches_loop;
168
- 

Return to bug 19368