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 600-605 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
600
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
600
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
601
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
601
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
602
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
602
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
603
('SerialSortIgnoreWords','des du de la le les leur d l an a the',NULL,'Words to ignore in serial search','Free'),
603
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
604
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
604
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
605
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
605
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
606
('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 289-295 Link Here
289
            [% ELSE %]
289
            [% ELSE %]
290
            <div id="opened">
290
            <div id="opened">
291
              [% IF openedsubscriptions %]
291
              [% IF openedsubscriptions %]
292
                  [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
292
                <table id="osrlt">
293
                  <thead>
294
                    <tr>
295
                        <th>Sort</th>
296
                        <th>ISSN</th>
297
                        <th class="anti-the">Title</th>
298
                        <th>Notes</th>
299
                        <th>Library</th>
300
                        <th>Location</th>
301
                        <th>Call number</th>
302
                        <th class="title-string">Expiration date</th>
303
                        [% FOR field IN additional_fields_for_subscription %]
304
                          <th>[% field.name %]</th>
305
                        [% END %]
306
                        <th class="NoSort">Actions</th>
307
                    </tr>
308
                  </thead>
309
                  <tfoot>
310
                    <tr>
311
                      <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td>
312
                      <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td>
313
                      <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td>
314
                      <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td>
315
                      <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td>
316
                      <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td>
317
                      <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td>
318
                      [% FOR field IN additional_fields_for_subscription %]
319
                        <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td>
320
                      [% END %]
321
                      <td colspan="2"></td>
322
                    </tr>
323
                  </tfoot>
324
                  <tbody>
325
                    [% FOREACH subscription IN openedsubscriptions %]
326
                    [% UNLESS subscription.cannotdisplay %]
327
                      <tr>
328
                        <td>[% IF ( subscription.titlesort ) %][% subscription.titlesort %][% END %]</td>
329
                        <td>
330
                        [% IF ( subscription.issn ) %][% subscription.issn %]
331
                        [% END %]
332
                        </td>
333
                        <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
334
                        </td>
335
                        <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %]
336
                        [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
337
                        </td>
338
                        <td>
339
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
340
                        </td>
341
                        <td>
342
                          [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
343
                        </td>
344
                        <td>
345
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
346
                        </td>
347
                        <td>
348
                            [% IF ( subscription.enddate ) %]
349
                                <span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span>
350
                            [% ELSE %]
351
                                <span title="0000-00-00"></span>
352
                            [% END %]
353
                        </td>
354
355
                        [% FOR field IN additional_fields_for_subscription %]
356
                          [% IF field.authorised_value_category %]
357
                            <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td>
358
                          [% ELSE %]
359
                            <td>[% subscription.additional_fields.${field.name} %]</td>
360
                          [% END %]
361
                        [% END %]
362
363
                        <td>
364
                            <div class="dropdown">
365
                                <div class="btn-group">
366
                                    [% IF ( CAN_user_serials_receive_serials ) %]
367
                                        [%# There should be no space between these two buttons, it would render badly %]
368
                                        <a class="btn btn-default btn-xs" role="button"
369
                                           href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7"><i
370
                                           class="fa fa-inbox"></i> Serial receive</a><a
371
                                           class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button"
372
                                           data-toggle="dropdown" href="#"><b class="caret"></b></a>
373
                                    [% ELSE %]
374
                                        <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>
375
                                    [% END %]
376
                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid %]">
377
378
                                    [% IF ( routing && CAN_user_serials_routing ) %]
379
                                        [% IF ( subscription.cannotedit ) %]
380
                                        [% ELSE %]
381
                                            [% IF ( subscription.routingedit ) %]
382
                                                <li>
383
                                                    <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit %])</a>
384
                                                </li>
385
                                            [% ELSE %]
386
                                                <li>
387
                                                    <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new"> <i class="fa fa-plus"></i> New routing list</a>
388
                                                </li>
389
                                            [% END %]
390
                                        [% END %]
391
                                    [% END # IF ( routing && CAN_user_serials_routing ) %]
392
393
                                    <li>
394
                                        <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a>
395
                                    </li>
396
                                </ul>
397
                                </div>
398
                            </div>
399
                        </td>
400
401
                      </tr>
402
                      [% END %]
403
                    [% END %]
404
                  </tbody>
405
                </table>
293
              [% ELSE %]
406
              [% ELSE %]
294
                <div class="dialog message">
407
                <div class="dialog message">
295
                  <p>Your search returned no open subscriptions.</p>
408
                  <p>Your search returned no open subscriptions.</p>
Lines 444-449 Link Here
444
                "sPaginationType": "full",
557
                "sPaginationType": "full",
445
                "order": [[ 2, "asc" ]],
558
                "order": [[ 2, "asc" ]],
446
                "aoColumnDefs": [
559
                "aoColumnDefs": [
560
                    { 'visible' : false, "targets" : 0},
561
                    { "iDataSort" : 0, 'aTargets' : [ 2 ] },
447
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
562
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
448
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
563
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
449
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
564
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
(-)a/serials/serials-search.pl (-9 / +28 lines)
Lines 37-42 use C4::Output; Link Here
37
use C4::Serials;
37
use C4::Serials;
38
use Koha::AdditionalFields;
38
use Koha::AdditionalFields;
39
39
40
use Encode;
41
use Unicode::Normalize;
42
40
use Koha::DateUtils;
43
use Koha::DateUtils;
41
use Koha::SharedContent;
44
use Koha::SharedContent;
42
45
Lines 154-169 else Link Here
154
        }
157
        }
155
    }
158
    }
156
159
157
    my (@openedsubscriptions, @closedsubscriptions);
160
#sort stopword by  string length
158
    for my $sub ( @subscriptions ) {
161
my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SerialSortIgnoreWords"));
159
        unless ( $sub->{closed} ) {
162
my $subsctitle;
160
            push @openedsubscriptions, $sub
163
my (@openedsubscriptions, @closedsubscriptions);
161
                unless $sub->{cannotdisplay};
164
for my $sub ( @subscriptions ) {
162
        } else {
165
    $subsctitle = $sub->{title} ? ucfirst($sub->{title}): '' ;
163
            push @closedsubscriptions, $sub
166
    if ($subsctitle){
164
                unless $sub->{cannotdisplay};
167
        $subsctitle = NFKD($subsctitle);
168
        $subsctitle =~ s/\p{NonspacingMark}//g;
169
        foreach my $stop (@sortedstopword){
170
            my $ucfirststop = ucfirst($stop);
171
            $subsctitle =~ s/$ucfirststop'//;
172
            $subsctitle =~ s/$ucfirststop //;
165
        }
173
        }
166
    }
174
    }
175
    $subsctitle =~ s/^\s+//;
176
    $sub->{titlesort} = ucfirst($subsctitle);
177
178
    warn $subsctitle;
179
180
     unless ( $sub->{closed} ) {
181
         push @openedsubscriptions, $sub
182
             unless $sub->{cannotdisplay};
183
    } else {
184
        push @closedsubscriptions, $sub
185
            unless $sub->{cannotdisplay};
186
    }
167
187
168
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
188
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
169
    my @branches_loop;
189
    my @branches_loop;
170
- 

Return to bug 19368