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 542-547 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
542
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
542
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
543
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
543
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
544
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
544
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
545
('SerialSortIgnoreWords','des du de la le les leur d l an a the',NULL,'Words to ignore in serial search','Free'),
545
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
546
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
546
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
547
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
547
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
548
('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 / +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 447-452 Link Here
447
                "sPaginationType": "four_button",
560
                "sPaginationType": "four_button",
448
                "order": [[ 2, "asc" ]],
561
                "order": [[ 2, "asc" ]],
449
                "aoColumnDefs": [
562
                "aoColumnDefs": [
563
                    { 'visible' : false, "targets" : 0},
564
                    { "iDataSort" : 0, 'aTargets' : [ 2 ] },
450
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
565
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
451
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
566
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
452
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
567
                    { '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 155-170 else Link Here
155
        }
158
        }
156
    }
159
    }
157
160
158
    my (@openedsubscriptions, @closedsubscriptions);
161
#sort stopword by  string length
159
    for my $sub ( @subscriptions ) {
162
my @sortedstopword = sort{ length $b <=> length $a } split ( / / ,C4::Context->preference("SerialSortIgnoreWords"));
160
        unless ( $sub->{closed} ) {
163
my $subsctitle;
161
            push @openedsubscriptions, $sub
164
my (@openedsubscriptions, @closedsubscriptions);
162
                unless $sub->{cannotdisplay};
165
for my $sub ( @subscriptions ) {
163
        } else {
166
    $subsctitle = $sub->{title} ? ucfirst($sub->{title}): '' ;
164
            push @closedsubscriptions, $sub
167
    if ($subsctitle){
165
                unless $sub->{cannotdisplay};
168
        $subsctitle = NFKD($subsctitle);
169
        $subsctitle =~ s/\p{NonspacingMark}//g;
170
        foreach my $stop (@sortedstopword){
171
            my $ucfirststop = ucfirst($stop);
172
            $subsctitle =~ s/$ucfirststop'//;
173
            $subsctitle =~ s/$ucfirststop //;
166
        }
174
        }
167
    }
175
    }
176
    $subsctitle =~ s/^\s+//;
177
    $sub->{titlesort} = ucfirst($subsctitle);
178
179
    warn $subsctitle;
180
181
     unless ( $sub->{closed} ) {
182
         push @openedsubscriptions, $sub
183
             unless $sub->{cannotdisplay};
184
    } else {
185
        push @closedsubscriptions, $sub
186
            unless $sub->{cannotdisplay};
187
    }
168
188
169
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
189
    my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } );
170
    my @branches_loop;
190
    my @branches_loop;
171
- 

Return to bug 19368