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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (+27 lines)
Lines 333-338 Link Here
333
                                    >
333
                                    >
334
                                    <span class="dt-column-order"></span>
334
                                    <span class="dt-column-order"></span>
335
                                </th>
335
                                </th>
336
                                [% SET sort_class = 'dt-orderable-asc dt-orderable-desc' %]
337
                                [% IF sortfield == 'dateaccessioned' %]
338
                                    [% sort_class = sort_class _ " dt-ordering-" _ direction %]
339
                                [% END %]
340
                                <th class="[% sort_class | html %]">
341
                                    <a
342
                                        href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]&amp;sortfield=dateaccessioned&amp;direction=[% IF sortfield != 'dateaccessioned' %]asc[% ELSE %][% new_direction | uri %][% END %]"
343
                                        >Date acquired</a
344
                                    >
345
                                </th>
336
                            </tr>
346
                            </tr>
337
                        </thead>
347
                        </thead>
338
                        [% FOREACH itemsloo IN itemsloop %]
348
                        [% FOREACH itemsloo IN itemsloop %]
Lines 399-404 Link Here
399
                                        [% END # /FOREACH item %]
409
                                        [% END # /FOREACH item %]
400
                                    </ul>
410
                                    </ul>
401
                                </td>
411
                                </td>
412
                                <td>
413
                                    <ul>
414
                                        [% FOREACH item IN itemsloo.ITEM_RESULTS %]
415
                                            <li>
416
                                                [% IF (item.dateaccessioned ) %]
417
                                                    [% item.dateaccessioned | $KohaDates %]
418
                                                [% END %]
419
                                            </li>
420
                                        [% END %]
421
                                    </ul>
422
                                </td>
402
                            </tr>
423
                            </tr>
403
                        [% END #/FOREACH itemsloo %]
424
                        [% END #/FOREACH itemsloo %]
404
                    </table>
425
                    </table>
Lines 473-478 Link Here
473
                            [% ELSE %]
494
                            [% ELSE %]
474
                                <option value="dateadded">Date added</option>
495
                                <option value="dateadded">Date added</option>
475
                            [% END %]
496
                            [% END %]
497
                            [% IF shelf.sortfield == "dateaccessioned" %]
498
                                <option value="dateaccessioned" selected="selected">Date acquired</option>
499
                            [% ELSE %]
500
                                <option value="dateaccessioned">Date added</option>
501
                            [% END %]
476
                        </select>
502
                        </select>
477
                    </li>
503
                    </li>
478
                    <li>
504
                    <li>
Lines 555-560 Link Here
555
                                        <option value="copyrightdate">Copyrightdate</option>
581
                                        <option value="copyrightdate">Copyrightdate</option>
556
                                        <option value="itemcallnumber">Call number</option>
582
                                        <option value="itemcallnumber">Call number</option>
557
                                        <option value="dateadded">Date added</option>
583
                                        <option value="dateadded">Date added</option>
584
                                        <option value="dateaccessioned">Date acquired</option>
558
                                    </select>
585
                                    </select>
559
                                </th>
586
                                </th>
560
                                <th></th>
587
                                <th></th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt (-1 / +1 lines)
Lines 21-27 Link Here
21
                "dt_owner":
21
                "dt_owner":
22
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% d.owner | html %]'>[% d.firstname | html | $To %] [% d.surname | html | $To %]</a>",
22
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% d.owner | html %]'>[% d.firstname | html | $To %] [% d.surname | html | $To %]</a>",
23
                "dt_sortby":
23
                "dt_sortby":
24
                    [% IF d.sortby == "author" %]"<span>Author</span>"[% ELSIF d.sortby == "copyrightdate" %]"<span>Year</span>"[% ELSIF d.sortby == "itemcallnumber" %]"<span>Call number</span>"[% ELSIF d.sortby == "dateadded" %]"<span>Date added</span>"[% ELSE %]"<span>Title</span>"[% END %],
24
                [% IF d.sortby == "author" %]"<span>Author</span>"[% ELSIF d.sortby == "copyrightdate" %]"<span>Year</span>"[% ELSIF d.sortby == "itemcallnumber" %]"<span>Call number</span>"[% ELSIF d.sortby == "dateadded" %]"<span>Date added</span>"[% ELSIF d.sortby == "dateaccessioned" %]"<span>Date acquired</span>"[% ELSE %]"<span>Title</span>"[% END %],
25
                "dt_created_on":
25
                "dt_created_on":
26
                    "[% d.created_on | $KohaDates %]",
26
                    "[% d.created_on | $KohaDates %]",
27
                "dt_modification_time":
27
                "dt_modification_time":
(-)a/virtualshelves/shelves.pl (-3 / +8 lines)
Lines 124-130 if ( $op eq 'add_form' ) { Link Here
124
        $op = $referer;
124
        $op = $referer;
125
        my $sortfield = $query->param('sortfield');
125
        my $sortfield = $query->param('sortfield');
126
        $sortfield = 'title'
126
        $sortfield = 'title'
127
            unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded );
127
            unless grep { $_ eq $sortfield }
128
            qw( title author copyrightdate publicationyear itemcallnumber dateadded dateaccessioned );
128
        if ( $sortfield == 'copyrightdate' and C4::Context->preference('marcflavour') == 'UNIMARC' ) {
129
        if ( $sortfield == 'copyrightdate' and C4::Context->preference('marcflavour') == 'UNIMARC' ) {
129
            $sortfield = 'publicationyear';
130
            $sortfield = 'publicationyear';
130
        }
131
        }
Lines 296-307 if ( $op eq 'view' ) { Link Here
296
                || 'title';    # Passed in sorting overrides default sorting
297
                || 'title';    # Passed in sorting overrides default sorting
297
            $sortfield = 'title'
298
            $sortfield = 'title'
298
                unless grep { $_ eq $sortfield }
299
                unless grep { $_ eq $sortfield }
299
                qw( title author copyrightdate publicationyear itemcallnumber dateadded );
300
                qw( title author copyrightdate publicationyear itemcallnumber dateadded dateaccessioned );
300
            if ( $sortfield == 'copyrightdate' and C4::Context->preference('marcflavour') == 'UNIMARC' ) {
301
            if ( $sortfield == 'copyrightdate' and C4::Context->preference('marcflavour') == 'UNIMARC' ) {
301
                $sortfield = 'publicationyear';
302
                $sortfield = 'publicationyear';
302
            }
303
            }
303
            my $direction = $query->param('direction') || 'asc';
304
            my $direction = $query->param('direction') || 'asc';
304
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
305
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
306
307
            # If sorting by dateaccessioned set direction to descending by default
308
            $direction = 'desc' if $sortfield eq 'dateaccessioned';
309
305
            my $rows;
310
            my $rows;
306
            if ( $query->param('print') ) {
311
            if ( $query->param('print') ) {
307
                $page = "";
312
                $page = "";
Lines 357-362 if ( $op eq 'view' ) { Link Here
357
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
362
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
358
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
363
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
359
                $this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour );
364
                $this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour );
365
                $this_item->{'dateaccessioned'} = $biblio->items->get_column("dateaccessioned");
360
366
361
                unless ( defined $this_item->{size} ) {
367
                unless ( defined $this_item->{size} ) {
362
368
363
- 

Return to bug 36188