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

(-)a/C4/Utils/DataTables/VirtualShelves.pm (-13 / +11 lines)
Lines 11-22 sub search { Link Here
11
    my $count = $params->{count};
11
    my $count = $params->{count};
12
    my $owner = $params->{owner};
12
    my $owner = $params->{owner};
13
    my $sortby = $params->{sortby};
13
    my $sortby = $params->{sortby};
14
    my $type = $params->{type};
14
    my $public = $params->{public} // 1;
15
    $public = $public ? 1 : 0;
15
    my $dt_params = $params->{dt_params};
16
    my $dt_params = $params->{dt_params};
16
17
17
    # public is default
18
    $type = 2 if not $type or $type != 1;
19
20
    # If not logged in user, be carreful and set the borrowernumber to 0
18
    # If not logged in user, be carreful and set the borrowernumber to 0
21
    # to prevent private lists lack
19
    # to prevent private lists lack
22
    my $loggedinuser = C4::Context->userenv->{'number'} || 0;
20
    my $loggedinuser = C4::Context->userenv->{'number'} || 0;
Lines 28-34 sub search { Link Here
28
    # FIXME refactore the following queries
26
    # FIXME refactore the following queries
29
    # We should call Koha::Virtualshelves
27
    # We should call Koha::Virtualshelves
30
    my $select = q|
28
    my $select = q|
31
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.category AS type,
29
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.public AS public,
32
        vs.created_on, vs.lastmodified as modification_time,
30
        vs.created_on, vs.lastmodified as modification_time,
33
        bo.surname, bo.firstname, vs.sortfield as sortby,
31
        bo.surname, bo.firstname, vs.sortfield as sortby,
34
        count(vc.biblionumber) as count
32
        count(vc.biblionumber) as count
Lines 45-51 sub search { Link Here
45
43
46
    my @args;
44
    my @args;
47
    # private
45
    # private
48
    if ( $type == 1 ) {
46
    if ( !$public ) {
49
        my $join_vs .= q|
47
        my $join_vs .= q|
50
            LEFT JOIN virtualshelfshares sh ON sh.shelfnumber = vs.shelfnumber
48
            LEFT JOIN virtualshelfshares sh ON sh.shelfnumber = vs.shelfnumber
51
            AND sh.borrowernumber = ?
49
            AND sh.borrowernumber = ?
Lines 71-80 sub search { Link Here
71
        push @args, $sortby;
69
        push @args, $sortby;
72
    }
70
    }
73
71
74
    push @where_strs, 'category = ?';
72
    push @where_strs, 'public = ?';
75
    push @args, $type;
73
    push @args, $public;
76
74
77
    if ( $type == 1 ) {
75
    if ( !$public ) {
78
        push @where_strs, '(vs.owner = ? OR sh.borrowernumber = ?)';
76
        push @where_strs, '(vs.owner = ? OR sh.borrowernumber = ?)';
79
        push @args, $loggedinuser, $loggedinuser;
77
        push @args, $loggedinuser, $loggedinuser;
80
    }
78
    }
Lines 95-101 sub search { Link Here
95
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
93
        $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}";
96
    }
94
    }
97
95
98
    my $group_by = " GROUP BY vs.shelfnumber, vs.shelfname, vs.owner, vs.category,
96
    my $group_by = " GROUP BY vs.shelfnumber, vs.shelfname, vs.owner, vs.public,
99
        vs.created_on, vs.lastmodified, bo.surname, bo.firstname, vs.sortfield ";
97
        vs.created_on, vs.lastmodified, bo.surname, bo.firstname, vs.sortfield ";
100
98
101
    my $query = join(
99
    my $query = join(
Lines 114-122 sub search { Link Here
114
    ($iTotalDisplayRecords) = $dbh->selectrow_array( $query, undef, @args );
112
    ($iTotalDisplayRecords) = $dbh->selectrow_array( $query, undef, @args );
115
113
116
    # Get the iTotalRecords DataTable variable
114
    # Get the iTotalRecords DataTable variable
117
    $query = q|SELECT COUNT(vs.shelfnumber)| . $from_total . q| WHERE category = ?|;
115
    $query = q|SELECT COUNT(vs.shelfnumber)| . $from_total . q| WHERE public = ?|;
118
    $query .= q| AND (vs.owner = ? OR sh.borrowernumber = ?)| if $type == 1;
116
    $query .= q| AND (vs.owner = ? OR sh.borrowernumber = ?)| if !$public;
119
    @args = $type == 1 ? ( $loggedinuser, $type, $loggedinuser, $loggedinuser ) : ( $type );
117
    @args = !$public ? ( $loggedinuser, $public, $loggedinuser, $loggedinuser ) : ( $public );
120
    ( $iTotalRecords ) = $dbh->selectrow_array( $query, undef, @args );
118
    ( $iTotalRecords ) = $dbh->selectrow_array( $query, undef, @args );
121
119
122
    for my $shelf ( @$shelves ) {
120
    for my $shelf ( @$shelves ) {
(-)a/Koha/Virtualshelf.pm (-13 / +12 lines)
Lines 37-53 Koha::Virtualshelf - Koha Virtualshelf Object class Link Here
37
37
38
=head1 API
38
=head1 API
39
39
40
=head2 Class Methods
40
=head2 Class methods
41
41
42
=cut
42
=cut
43
43
44
=head3 type
45
46
=cut
47
48
our $PRIVATE = 1;
49
our $PUBLIC = 2;
50
51
sub store {
44
sub store {
52
    my ( $self ) = @_;
45
    my ( $self ) = @_;
53
46
Lines 72-83 sub store { Link Here
72
65
73
sub is_public {
66
sub is_public {
74
    my ( $self ) = @_;
67
    my ( $self ) = @_;
75
    return $self->category == $PUBLIC;
68
    return $self->public;
76
}
69
}
77
70
78
sub is_private {
71
sub is_private {
79
    my ( $self ) = @_;
72
    my ( $self ) = @_;
80
    return $self->category == $PRIVATE;
73
    return !$self->public;
81
}
74
}
82
75
83
sub is_shelfname_valid {
76
sub is_shelfname_valid {
Lines 93-106 sub is_shelfname_valid { Link Here
93
            "virtualshelfshares.borrowernumber" => $self->owner,
86
            "virtualshelfshares.borrowernumber" => $self->owner,
94
            "me.owner" => $self->owner,
87
            "me.owner" => $self->owner,
95
        };
88
        };
96
        $conditions->{category} = $PRIVATE;
89
        $conditions->{public} = 0;
97
    }
90
    }
98
    elsif ( $self->is_private and not defined $self->owner ) {
91
    elsif ( $self->is_private and not defined $self->owner ) {
99
        $conditions->{owner} = undef;
92
        $conditions->{owner} = undef;
100
        $conditions->{category} = $PRIVATE;
93
        $conditions->{public} = 0;
101
    }
94
    }
102
    else {
95
    else {
103
        $conditions->{category} = $PUBLIC;
96
        $conditions->{public} = 1;
104
    }
97
    }
105
98
106
    my $count = Koha::Virtualshelves->search(
99
    my $count = Koha::Virtualshelves->search(
Lines 262-267 sub can_biblios_be_removed { Link Here
262
    # Same answer since bug 18228
255
    # Same answer since bug 18228
263
}
256
}
264
257
258
=head2 Internal methods
259
260
=head3 _type
261
262
=cut
263
265
sub _type {
264
sub _type {
266
    return 'Virtualshelve';
265
    return 'Virtualshelve';
267
}
266
}
(-)a/Koha/Virtualshelves.pm (-8 / +8 lines)
Lines 46-52 sub get_private_shelves { Link Here
46
46
47
    $self->search(
47
    $self->search(
48
        {
48
        {
49
            category => 1,
49
            public => 0,
50
            -or => {
50
            -or => {
51
                'virtualshelfshares.borrowernumber' => $borrowernumber,
51
                'virtualshelfshares.borrowernumber' => $borrowernumber,
52
                'me.owner' => $borrowernumber,
52
                'me.owner' => $borrowernumber,
Lines 69-75 sub get_public_shelves { Link Here
69
69
70
    $self->search(
70
    $self->search(
71
        {
71
        {
72
            category => 2,
72
            public => 1,
73
        },
73
        },
74
        {
74
        {
75
            distinct => 'shelfnumber',
75
            distinct => 'shelfnumber',
Lines 82-88 sub get_public_shelves { Link Here
82
sub get_some_shelves {
82
sub get_some_shelves {
83
    my ( $self, $params ) = @_;
83
    my ( $self, $params ) = @_;
84
    my $borrowernumber = $params->{borrowernumber} || 0;
84
    my $borrowernumber = $params->{borrowernumber} || 0;
85
    my $category = $params->{category} || 1;
85
    my $public = $params->{public} || 0;
86
    my $add_allowed = $params->{add_allowed};
86
    my $add_allowed = $params->{add_allowed};
87
87
88
    my @conditions;
88
    my @conditions;
Lines 98-104 sub get_some_shelves { Link Here
98
            ]
98
            ]
99
        };
99
        };
100
    }
100
    }
101
    if ( $category == 1 ) {
101
    if ( !$public ) {
102
        push @conditions, {
102
        push @conditions, {
103
            -or =>
103
            -or =>
104
            {
104
            {
Lines 110-116 sub get_some_shelves { Link Here
110
110
111
    $self->search(
111
    $self->search(
112
        {
112
        {
113
            category => $category,
113
            public => $public,
114
            ( @conditions ? ( -and => \@conditions ) : () ),
114
            ( @conditions ? ( -and => \@conditions ) : () ),
115
        },
115
        },
116
        {
116
        {
Lines 132-138 sub get_shelves_containing_record { Link Here
132
          {
132
          {
133
              -or => [
133
              -or => [
134
                {
134
                {
135
                    category => 1,
135
                    public => 0,
136
                    -or      => {
136
                    -or      => {
137
                        'me.owner' => $borrowernumber,
137
                        'me.owner' => $borrowernumber,
138
                        -or        => {
138
                        -or        => {
Lines 140-150 sub get_shelves_containing_record { Link Here
140
                        },
140
                        },
141
                    }
141
                    }
142
                },
142
                },
143
                { category => 2 },
143
                { public => 1 },
144
            ]
144
            ]
145
          };
145
          };
146
    } else {
146
    } else {
147
        push @conditions, { category => 2 };
147
        push @conditions, { public => 1 };
148
    }
148
    }
149
149
150
    return Koha::Virtualshelves->search(
150
    return Koha::Virtualshelves->search(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-28 / +22 lines)
Lines 2-9 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% SET PRIVATE = 1 %]
6
[% SET PUBLIC = 2 %]
7
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
9
<title>
7
<title>
Lines 66-72 Link Here
66
        [% IF shelf AND shelf.is_private %]
64
        [% IF shelf AND shelf.is_private %]
67
            [% IF op == 'view' OR op == 'edit_form' %]
65
            [% IF op == 'view' OR op == 'edit_form' %]
68
                <li>
66
                <li>
69
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;category=[% PRIVATE | uri %]">Your lists</a>
67
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;public=0">Your lists</a>
70
                </li>
68
                </li>
71
            [% ELSE %]
69
            [% ELSE %]
72
                <li>
70
                <li>
Lines 79-85 Link Here
79
        [% ELSIF shelf AND shelf.is_public %]
77
        [% ELSIF shelf AND shelf.is_public %]
80
            [% IF op == 'view' %]
78
            [% IF op == 'view' %]
81
                <li>
79
                <li>
82
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;category=[% PUBLIC | uri %]">Public lists</a>
80
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;public=1">Public lists</a>
83
                </li>
81
                </li>
84
            [% ELSE %]
82
            [% ELSE %]
85
                <li>
83
                <li>
Lines 352-368 Link Here
352
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
350
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
353
            [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
351
            [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %]
354
            </select></li>
352
            </select></li>
355
            <li><label for="category">Category: </label>
353
            <li><label for="public">Public: </label>
356
                <select id="category" name="category" onchange="AdjustRemark()">
354
                <select id="public" name="public" onchange="AdjustRemark()">
357
                [% IF shelf.is_private %]
355
                [% IF shelf.is_private %]
358
                    <option value="1" selected="selected">Private</option>
356
                    <option value="0" selected="selected">Private</option>
359
                [% ELSE %]
357
                [% ELSE %]
360
                    <option value="1">Private</option>
358
                    <option value="0">Private</option>
361
                [% END %]
359
                [% END %]
362
                [% IF shelf.is_public %]
360
                [% IF shelf.is_public %]
363
                    <option value="2" selected="selected">Public</option>
361
                    <option value="1" selected="selected">Public</option>
364
                [% ELSE %]
362
                [% ELSE %]
365
                    <option value="2">Public</option>
363
                    <option value="1">Public</option>
366
                [% END %]
364
                [% END %]
367
                           </select></li>
365
                           </select></li>
368
366
Lines 376-385 Link Here
376
        [% IF referer == 'view' %]
374
        [% IF referer == 'view' %]
377
           <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
375
           <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
378
       [% ELSE %]
376
       [% ELSE %]
379
            [% IF category == PUBLIC %]
377
            [% IF public %]
380
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;category=[% PUBLIC | uri %]" class="cancel">Cancel</a>
378
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;public=1" class="cancel">Cancel</a>
381
            [% ELSE %]
379
            [% ELSE %]
382
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
380
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&amp;public=0" class="cancel">Cancel</a>
383
            [% END %]
381
            [% END %]
384
        [% END %]
382
        [% END %]
385
    </fieldset>
383
    </fieldset>
Lines 510-520 Link Here
510
508
511
        [% IF op == 'list' %]
509
        [% IF op == 'list' %]
512
            $(document).ready(function(){
510
            $(document).ready(function(){
513
                [% IF category == PUBLIC %]
511
                var public = [% public | html %];
514
                    var type = [% PUBLIC | html %];
515
                [% ELSE %]
516
                    var type = [% PRIVATE | html %];
517
                [% END %]
518
512
519
                var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
513
                var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
520
                "aaSorting": [[ 5, "asc" ]],
514
                "aaSorting": [[ 5, "asc" ]],
Lines 522-529 Link Here
522
                    'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
516
                    'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
523
                    'fnServerData': function(sSource, aoData, fnCallback) {
517
                    'fnServerData': function(sSource, aoData, fnCallback) {
524
                        aoData.push({
518
                        aoData.push({
525
                            'name': 'type',
519
                            'name': 'public',
526
                            'value': type,
520
                            'value': public,
527
                        },{
521
                        },{
528
                            'name': 'shelfname',
522
                            'name': 'shelfname',
529
                            'value': $("#searchshelfname_filter").val(),
523
                            'value': $("#searchshelfname_filter").val(),
Lines 541-547 Link Here
541
                            'value': 'vs.shelfname',
535
                            'value': 'vs.shelfname',
542
                        },{
536
                        },{
543
                            'name': 'is_shared_sorton',
537
                            'name': 'is_shared_sorton',
544
                            'value': 'vs.category',
538
                            'value': 'vs.public',
545
                        },{
539
                        },{
546
                            'name': 'owner_sorton',
540
                            'name': 'owner_sorton',
547
                            'value': 'vs.owner',
541
                            'value': 'vs.owner',
Lines 566-572 Link Here
566
                        });
560
                        });
567
                    },
561
                    },
568
                    'aoColumns':[
562
                    'aoColumns':[
569
                        { 'mDataProp': 'dt_type' },
563
                        { 'mDataProp': 'dt_public' },
570
                        { 'mDataProp': 'dt_shelfname' },
564
                        { 'mDataProp': 'dt_shelfname' },
571
                        { 'mDataProp': 'dt_count' },
565
                        { 'mDataProp': 'dt_count' },
572
                        { 'mDataProp': 'dt_is_shared' },
566
                        { 'mDataProp': 'dt_is_shared' },
Lines 589-595 Link Here
589
                dtListResults.fnAddFilters("filter", 750);
583
                dtListResults.fnAddFilters("filter", 750);
590
584
591
                var tabs = $("#tabs").tabs({
585
                var tabs = $("#tabs").tabs({
592
                    [% IF category == PUBLIC %]
586
                    [% IF public %]
593
                        active: 1,
587
                        active: 1,
594
                    [% ELSE %]
588
                    [% ELSE %]
595
                        active: 0,
589
                        active: 0,
Lines 597-606 Link Here
597
                    activate: function(e, ui) {
591
                    activate: function(e, ui) {
598
                        var active = tabs.tabs("option", "active" );
592
                        var active = tabs.tabs("option", "active" );
599
                        if ( active == 0 ) {
593
                        if ( active == 0 ) {
600
                            type = [% PRIVATE | html %];
594
                            public = 0;
601
                            dtListResults.fnDraw();
595
                            dtListResults.fnDraw();
602
                        } else if ( active == 1 ) {
596
                        } else if ( active == 1 ) {
603
                            type = [% PUBLIC | html %];
597
                            public = 1;
604
                            dtListResults.fnDraw();
598
                            dtListResults.fnDraw();
605
                        }
599
                        }
606
                    }
600
                    }
Lines 804-815 Link Here
804
        }
798
        }
805
799
806
        function AdjustRemark() {
800
        function AdjustRemark() {
807
            var category = $("#category").val();
801
            var public = $("#public").val();
808
            var perms = $("#allow_changes_from").val();
802
            var perms = $("#allow_changes_from").val();
809
803
810
            if( perms < 2 ) {
804
            if( perms < 2 ) {
811
                $("#anyone_remark").hide();
805
                $("#anyone_remark").hide();
812
            } else if( category==1 ) {
806
            } else if( public==0 ) {
813
                // If we move to Private (without shares), show Anyone remark
807
                // If we move to Private (without shares), show Anyone remark
814
                // Note: the number of shares is not tested real-time
808
                // Note: the number of shares is not tested real-time
815
                [% IF !shelf.is_shared %]
809
                [% IF !shelf.is_shared %]
Lines 817-823 Link Here
817
                [% ELSE %]
811
                [% ELSE %]
818
                    $("#anyone_remark").hide();
812
                    $("#anyone_remark").hide();
819
                [% END %]
813
                [% END %]
820
            } else { // category==2
814
            } else { // public==1
821
                $("#anyone_remark").hide();
815
                $("#anyone_remark").hide();
822
            }
816
            }
823
        }
817
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt (-6 / +6 lines)
Lines 8-21 Link Here
8
    "aaData": [
8
    "aaData": [
9
        [% FOREACH data IN aaData %]
9
        [% FOREACH data IN aaData %]
10
            {
10
            {
11
                "dt_type":
11
                "dt_public":
12
                    "[% data.type | html %]",
12
                    "[% data.public | html %]",
13
                "dt_shelfname":
13
                "dt_shelfname":
14
                    "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber | html %]'>[% data.shelfname | html | $To %]</a>",
14
                    "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber | html %]'>[% data.shelfname | html | $To %]</a>",
15
                "dt_count":
15
                "dt_count":
16
                    "[% data.count | html %] item(s)",
16
                    "[% data.count | html %] item(s)",
17
                "dt_is_shared":
17
                "dt_is_shared":
18
                    "[% IF data.type == 2 %]Public[% ELSIF data.is_shared %]Shared[% ELSE %]Private[% END %]",
18
                    "[% IF data.public %]Public[% ELSIF data.is_shared %]Shared[% ELSE %]Private[% END %]",
19
                "dt_owner":
19
                "dt_owner":
20
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner | html %]'>[% data.firstname | html | $To %] [% data.surname | html | $To %]</a>",
20
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner | html %]'>[% data.firstname | html | $To %] [% data.surname | html | $To %]</a>",
21
                "dt_sortby":
21
                "dt_sortby":
Lines 35-46 Link Here
35
[%~ SET action_block = '' ~%]
35
[%~ SET action_block = '' ~%]
36
[%~ IF can_manage_shelf OR can_delete_shelf ~%]
36
[%~ IF can_manage_shelf OR can_delete_shelf ~%]
37
    [%~ shelfnumber = shelfnumber | html ~%]
37
    [%~ shelfnumber = shelfnumber | html ~%]
38
    [%~ type        = type | html ~%]
38
    [%~ public      = public | html ~%]
39
    [%~ IF can_manage_shelf ~%]
39
    [%~ IF can_manage_shelf ~%]
40
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
40
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
41
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
41
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
42
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
42
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
45
        [%~ action_block = action_block _ '<button class="editshelf btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</button>' ~%]
45
        [%~ action_block = action_block _ '<button class="editshelf btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</button>' ~%]
46
        [%~ action_block = action_block _ '</form> ' ~%]
46
        [%~ action_block = action_block _ '</form> ' ~%]
Lines 50-56 Link Here
50
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
50
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
53
        [%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
53
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
54
        [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
54
        [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
55
        [%~ action_block = action_block _ '<button type="submit" class="deleteshelf btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>' ~%]
55
        [%~ action_block = action_block _ '<button type="submit" class="deleteshelf btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>' ~%]
56
        [%~ action_block = action_block _ '</form>' ~%]
56
        [%~ action_block = action_block _ '</form>' ~%]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-38 / +36 lines)
Lines 1-8 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% SET PRIVATE = 1 %]
5
[% SET PUBLIC = 2 %]
6
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
4
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
7
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
5
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
8
6
Lines 10-16 Link Here
10
    <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline">
8
    <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline">
11
        <input type="hidden" name="op" value="delete" />
9
        <input type="hidden" name="op" value="delete" />
12
        <input type="hidden" name="referer" value="list" />
10
        <input type="hidden" name="referer" value="list" />
13
        <input type='hidden' name='category' value='[% category | html %]' />
11
        <input type='hidden' name='public' value='[% public | html %]' />
14
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
12
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
15
        <button type="submit" class="btn btn-link remove deleteshelf" data-shelfnumber="[% shelf.shelfnumber | html %]" data-shelfname="[% shelf.shelfname | html %]" data-shared="[% shelf.is_shared | html %]" data-count="[% contents.count | html %]">
13
        <button type="submit" class="btn btn-link remove deleteshelf" data-shelfnumber="[% shelf.shelfnumber | html %]" data-shelfname="[% shelf.shelfname | html %]" data-shared="[% shelf.is_shared | html %]" data-count="[% contents.count | html %]">
16
            <i class="fa fa-remove" aria-hidden="true"></i>
14
            <i class="fa fa-remove" aria-hidden="true"></i>
Lines 80-86 Link Here
80
            [% IF shelf and shelf.is_private %]
78
            [% IF shelf and shelf.is_private %]
81
                [% IF op == 'view' OR op == 'edit_form' %]
79
                [% IF op == 'view' OR op == 'edit_form' %]
82
                    <li class="breadcrumb-item">
80
                    <li class="breadcrumb-item">
83
                        <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]">Your lists</a>
81
                        <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a>
84
                    </li>
82
                    </li>
85
                [% ELSE %]
83
                [% ELSE %]
86
                    <li class="breadcrumb-item active">
84
                    <li class="breadcrumb-item active">
Lines 90-96 Link Here
90
            [% ELSIF shelf AND shelf.is_public %]
88
            [% ELSIF shelf AND shelf.is_public %]
91
                [% IF op == 'view' %]
89
                [% IF op == 'view' %]
92
                    <li class="breadcrumb-item">
90
                    <li class="breadcrumb-item">
93
                        <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | uri %]">Public lists</a>
91
                        <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a>
94
                    </li>
92
                    </li>
95
                [% ELSE %]
93
                [% ELSE %]
96
                    <li class="breadcrumb-item active">
94
                    <li class="breadcrumb-item active">
Lines 231-251 Link Here
231
                                            <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
229
                                            <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
232
                                                <input type="hidden" name="op" value="edit_form" />
230
                                                <input type="hidden" name="op" value="edit_form" />
233
                                                <input type="hidden" name="referer" value="view" />
231
                                                <input type="hidden" name="referer" value="view" />
234
                                                <input type='hidden' name='category' value='[% shelf.category | html %]' />
232
                                                <input type='hidden' name='public' value='[% shelf.public | html %]' />
235
                                                <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
233
                                                <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
236
                                                <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
234
                                                <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
237
                                            </form>
235
                                            </form>
238
236
239
                                            [% PROCESS delete_shelf context = "details" %]
237
                                            [% PROCESS delete_shelf context = "details" %]
240
238
241
                                            [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
239
                                            [% IF !public && Koha.Preference('OpacAllowSharingPrivateLists') %]
242
                                                <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share" aria-hidden="true"></i> Share list</a>
240
                                                <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share" aria-hidden="true"></i> Share list</a>
243
                                            [% END %]
241
                                            [% END %]
244
                                        [% ELSIF category == PRIVATE # not manageshelf and private means shared %]
242
                                        [% ELSIF !public # not manageshelf and private means shared %]
245
                                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="unshare[% shelf.shelfnumber | html %]" class="d-inline">
243
                                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="unshare[% shelf.shelfnumber | html %]" class="d-inline">
246
                                                <input type="hidden" name="op" value="remove_share" />
244
                                                <input type="hidden" name="op" value="remove_share" />
247
                                                <input type="hidden" name="referer" value="list" />
245
                                                <input type="hidden" name="referer" value="list" />
248
                                                <input type='hidden' name='category' value='[% category | html %]' />
246
                                                <input type='hidden' name='public' value='[% public | html %]' />
249
                                                <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
247
                                                <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
250
                                                <button type="submit" class="btn btn-link remove remove_share" data-shelfname="[% shelf.shelfname | html %]" data-shelfnumber="[% shelf.shelfnumber | html %]">
248
                                                <button type="submit" class="btn btn-link remove remove_share" data-shelfname="[% shelf.shelfname | html %]" data-shelfnumber="[% shelf.shelfnumber | html %]">
251
                                                    <i class="fa fa-remove" aria-hidden="true"></i> Remove share
249
                                                    <i class="fa fa-remove" aria-hidden="true"></i> Remove share
Lines 522-528 Link Here
522
                                        <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
520
                                        <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
523
                                            <input type="hidden" name="op" value="edit_form" />
521
                                            <input type="hidden" name="op" value="edit_form" />
524
                                            <input type="hidden" name="referer" value="view" />
522
                                            <input type="hidden" name="referer" value="view" />
525
                                            <input type="hidden" name="category" value="[% shelf.category | html %]" />
523
                                            <input type="hidden" name="public" value="[% shelf.public | html %]" />
526
                                            <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
524
                                            <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
527
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
525
                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
528
                                        </form>
526
                                        </form>
Lines 600-618 Link Here
600
                                            [% END %]
598
                                            [% END %]
601
                                        </select>
599
                                        </select>
602
                                    </li>
600
                                    </li>
603
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
601
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
604
                                        <li>
602
                                        <li>
605
                                            <label for="category">Category:</label>
603
                                            <label for="public">Category:</label>
606
                                            <select name="category" id="category" onchange="AdjustRemark()">
604
                                            <select name="public" id="public" onchange="AdjustRemark()">
607
                                                [% IF shelf.is_private %]
605
                                                [% IF shelf.is_private %]
608
                                                        <option value="1" selected="selected">Private</option>
606
                                                        <option value="0" selected="selected">Private</option>
609
                                                    [% ELSE %]
607
                                                    [% ELSE %]
610
                                                        <option value="1">Private</option>
608
                                                        <option value="0">Private</option>
611
                                                    [% END %]
609
                                                    [% END %]
612
                                                [% IF shelf.is_public %]
610
                                                [% IF shelf.is_public %]
613
                                                    <option value="2" selected="selected">Public</option>
611
                                                    <option value="1" selected="selected">Public</option>
614
                                                [% ELSE %]
612
                                                [% ELSE %]
615
                                                    <option value="2">Public</option>
613
                                                    <option value="1">Public</option>
616
                                                [% END %]
614
                                                [% END %]
617
                                            </select>
615
                                            </select>
618
                                            [% IF shelf.is_public AND NOT Koha.Preference('OpacAllowPublicListCreation') %]
616
                                            [% IF shelf.is_public AND NOT Koha.Preference('OpacAllowPublicListCreation') %]
Lines 622-629 Link Here
622
                                    [% END %]
620
                                    [% END %]
623
                                    [% INCLUDE list_permissions %]
621
                                    [% INCLUDE list_permissions %]
624
                                </ol>
622
                                </ol>
625
                                [% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
623
                                [% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
626
                                    <input type="hidden" name="category" value="[% PRIVATE | html %]" />
624
                                    <input type="hidden" name="public" value="0" />
627
                                [% END %]
625
                                [% END %]
628
                            </fieldset> <!-- /.rows -->
626
                            </fieldset> <!-- /.rows -->
629
627
Lines 632-638 Link Here
632
                                [% IF referer == 'view' %]
630
                                [% IF referer == 'view' %]
633
                                    <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
631
                                    <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
634
                                [% ELSE %]
632
                                [% ELSE %]
635
                                    <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
633
                                    <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0" class="cancel">Cancel</a>
636
                                [% END %]
634
                                [% END %]
637
                            </fieldset>
635
                            </fieldset>
638
                        </form>
636
                        </form>
Lines 642-667 Link Here
642
                        <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
640
                        <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
643
                            <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
641
                            <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
644
                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
642
                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
645
                                    [% IF category == PRIVATE %]
643
                                    [% IF !public %]
646
                                        <li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | html %]">Your lists</a></li>
644
                                        <li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a></li>
647
                                    [% ELSE %]
645
                                    [% ELSE %]
648
                                        <li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | html %]">Your lists</a></li>
646
                                        <li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=0">Your lists</a></li>
649
                                    [% END %]
647
                                    [% END %]
650
                                [% END %]
648
                                [% END %]
651
                                [% IF category == PUBLIC %]
649
                                [% IF public %]
652
                                    <li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
650
                                    <li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a></li>
653
                                [% ELSE %]
651
                                [% ELSE %]
654
                                    <li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
652
                                    <li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;public=1">Public lists</a></li>
655
                                [% END %]
653
                                [% END %]
656
                            </ul>
654
                            </ul>
657
655
658
                            [% IF category == PRIVATE %]
656
                            [% IF !public %]
659
                                <div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
657
                                <div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
660
                            [% ELSE %]
658
                            [% ELSE %]
661
                                <div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
659
                                <div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
662
                            [% END %]
660
                            [% END %]
663
661
664
                            [% IF category == PRIVATE || Koha.Preference('OpacAllowPublicListCreation') %]
662
                            [% IF !public || Koha.Preference('OpacAllowPublicListCreation') %]
665
                                [% IF loggedinusername %]
663
                                [% IF loggedinusername %]
666
                                    <div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div>
664
                                    <div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div>
667
                                [% ELSE %]
665
                                [% ELSE %]
Lines 673-681 Link Here
673
671
674
                            [% IF shelves.count %]
672
                            [% IF shelves.count %]
675
                                <table class="table">
673
                                <table class="table">
676
                                    [% IF category == PRIVATE %]
674
                                    [% IF !public %]
677
                                    <caption class="sr-only">Your lists</caption>
675
                                    <caption class="sr-only">Your lists</caption>
678
                                    [% ELSIF category == PUBLIC %]
676
                                    [% ELSIF public %]
679
                                    <caption class="sr-only">Public lists</caption>
677
                                    <caption class="sr-only">Public lists</caption>
680
                                    [% END %]
678
                                    [% END %]
681
                                    <thead>
679
                                    <thead>
Lines 703-709 Link Here
703
                                                    [% IF s.can_be_managed( loggedinusernumber ) %]
701
                                                    [% IF s.can_be_managed( loggedinusernumber ) %]
704
                                                        <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline">
702
                                                        <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline">
705
                                                            <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
703
                                                            <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
706
                                                            <input type="hidden" name="category" value="[% s.category | html %]" />
704
                                                            <input type="hidden" name="public" value="[% s.public | html %]" />
707
                                                            <input type="hidden" name="op" value="edit_form" />
705
                                                            <input type="hidden" name="op" value="edit_form" />
708
                                                            <input type="hidden" name="referer" value="list" />
706
                                                            <input type="hidden" name="referer" value="list" />
709
                                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button>
707
                                                            <button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button>
Lines 719-725 Link Here
719
                                                        <form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline">
717
                                                        <form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline">
720
                                                            <input type="hidden" name="op" value="remove_share" />
718
                                                            <input type="hidden" name="op" value="remove_share" />
721
                                                            <input type="hidden" name="referer" value="list" />
719
                                                            <input type="hidden" name="referer" value="list" />
722
                                                            <input type='hidden' name='category' value='[% category | html %]' />
720
                                                            <input type='hidden' name='public' value='[% public | html %]' />
723
                                                            <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
721
                                                            <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
724
                                                            <button type="submit" class="btn btn-link remove remove_share"
722
                                                            <button type="submit" class="btn btn-link remove remove_share"
725
                                                            data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button>
723
                                                            data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button>
Lines 732-738 Link Here
732
                                </table> <!-- /.table -->
730
                                </table> <!-- /.table -->
733
                                <div class="pages">[% pagination_bar | $raw %]</div>
731
                                <div class="pages">[% pagination_bar | $raw %]</div>
734
                            [% ELSE %]
732
                            [% ELSE %]
735
                                [% IF category == PUBLIC %]
733
                                [% IF public %]
736
                                    <p>No public lists.</p>
734
                                    <p>No public lists.</p>
737
                                [% ELSIF loggedinusernumber %]
735
                                [% ELSIF loggedinusernumber %]
738
                                    <p>No private lists.</p>
736
                                    <p>No private lists.</p>
Lines 1031-1047 function sortMenu( sorting_form ){ Link Here
1031
}
1029
}
1032
1030
1033
function AdjustRemark() {
1031
function AdjustRemark() {
1034
    var category;
1032
    var public;
1035
    if( $("#category").length > 0 ) {
1033
    if( $("#public").length > 0 ) {
1036
        category = $("#category").val();
1034
        public = $("#public").val();
1037
    } else {
1035
    } else {
1038
        category = "[% category | html %]";
1036
        public = "[% public | html %]";
1039
    }
1037
    }
1040
    var perms = $("#allow_changes_from").val();
1038
    var perms = $("#allow_changes_from").val();
1041
1039
1042
    if( perms < 2 ) {
1040
    if( perms < 2 ) {
1043
        $("#anyone_remark").hide();
1041
        $("#anyone_remark").hide();
1044
    } else if( category==1 ) {
1042
    } else if( public==0 ) {
1045
        // If we move to Private (without shares), show Anyone remark
1043
        // If we move to Private (without shares), show Anyone remark
1046
        // Note: the number of shares is not tested real-time
1044
        // Note: the number of shares is not tested real-time
1047
        [% IF !shelf.is_shared %]
1045
        [% IF !shelf.is_shared %]
(-)a/opac/opac-shelves.pl (-9 / +9 lines)
Lines 83-90 if (C4::Context->preference("BakerTaylorEnabled")) { Link Here
83
}
83
}
84
84
85
my $referer  = $query->param('referer')  || $op;
85
my $referer  = $query->param('referer')  || $op;
86
my $category = 1;
86
my $public = 0;
87
$category = 2 if $query->param('category') && $query->param('category') == 2;
87
$public = 1 if $query->param('public') && $query->param('public') == 1;
88
88
89
my ( $shelf, $shelfnumber, @messages );
89
my ( $shelf, $shelfnumber, @messages );
90
90
Lines 96-102 if ( $op eq 'add_form' ) { Link Here
96
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
96
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
97
97
98
    if ( $shelf ) {
98
    if ( $shelf ) {
99
        $category = $shelf->category;
99
        $public = $shelf->public;
100
        my $patron = Koha::Patrons->find( $shelf->owner );
100
        my $patron = Koha::Patrons->find( $shelf->owner );
101
        $template->param( owner => $patron, );
101
        $template->param( owner => $patron, );
102
        unless ( $shelf->can_be_managed( $loggedinuser ) ) {
102
        unless ( $shelf->can_be_managed( $loggedinuser ) ) {
Lines 113-119 if ( $op eq 'add_form' ) { Link Here
113
            $shelf = Koha::Virtualshelf->new(
113
            $shelf = Koha::Virtualshelf->new(
114
                {   shelfname          => scalar $query->param('shelfname'),
114
                {   shelfname          => scalar $query->param('shelfname'),
115
                    sortfield          => scalar $query->param('sortfield'),
115
                    sortfield          => scalar $query->param('sortfield'),
116
                    category           => $category,
116
                    public             => $public,
117
                    allow_change_from_owner => $allow_changes_from > 0,
117
                    allow_change_from_owner => $allow_changes_from > 0,
118
                    allow_change_from_others => $allow_changes_from == ANYONE,
118
                    allow_change_from_others => $allow_changes_from == ANYONE,
119
                    owner              => scalar $loggedinuser,
119
                    owner              => scalar $loggedinuser,
Lines 147-153 if ( $op eq 'add_form' ) { Link Here
147
            my $allow_changes_from = $query->param('allow_changes_from');
147
            my $allow_changes_from = $query->param('allow_changes_from');
148
            $shelf->allow_change_from_owner( $allow_changes_from > 0 );
148
            $shelf->allow_change_from_owner( $allow_changes_from > 0 );
149
            $shelf->allow_change_from_others( $allow_changes_from == ANYONE );
149
            $shelf->allow_change_from_others( $allow_changes_from == ANYONE );
150
            $shelf->category( $category );
150
            $shelf->public( $public );
151
            eval { $shelf->store };
151
            eval { $shelf->store };
152
152
153
            if ($@) {
153
            if ($@) {
Lines 259-265 if ( $op eq 'view' ) { Link Here
259
    $shelf = Koha::Virtualshelves->find($shelfnumber);
259
    $shelf = Koha::Virtualshelves->find($shelfnumber);
260
    if ( $shelf ) {
260
    if ( $shelf ) {
261
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
261
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
262
            $category = $shelf->category;
262
            $public = $shelf->public;
263
263
264
            # Sortfield param may still include sort order with :asc or :desc, but direction overrides it
264
            # Sortfield param may still include sort order with :asc or :desc, but direction overrides it
265
            my( $sortfield, $direction );
265
            my( $sortfield, $direction );
Lines 424-430 if ( $op eq 'view' ) { Link Here
424
if ( $op eq 'list' ) {
424
if ( $op eq 'list' ) {
425
    my $shelves;
425
    my $shelves;
426
    my ( $page, $rows ) = ( $query->param('page') || 1, 20 );
426
    my ( $page, $rows ) = ( $query->param('page') || 1, 20 );
427
    if ( $category == 1 ) {
427
    if ( !$public ) {
428
        $shelves = Koha::Virtualshelves->get_private_shelves({ page => $page, rows => $rows, borrowernumber => $loggedinuser, });
428
        $shelves = Koha::Virtualshelves->get_private_shelves({ page => $page, rows => $rows, borrowernumber => $loggedinuser, });
429
    } else {
429
    } else {
430
        $shelves = Koha::Virtualshelves->get_public_shelves({ page => $page, rows => $rows, });
430
        $shelves = Koha::Virtualshelves->get_public_shelves({ page => $page, rows => $rows, });
Lines 435-441 if ( $op eq 'list' ) { Link Here
435
        shelves => $shelves,
435
        shelves => $shelves,
436
        pagination_bar => pagination_bar(
436
        pagination_bar => pagination_bar(
437
            q||, $pager->last_page - $pager->first_page + 1,
437
            q||, $pager->last_page - $pager->first_page + 1,
438
            $page, "page", { op => 'list', category => $category, }
438
            $page, "page", { op => 'list', public => $public, }
439
        ),
439
        ),
440
    );
440
    );
441
}
441
}
Lines 445-451 $template->param( Link Here
445
    referer  => $referer,
445
    referer  => $referer,
446
    shelf    => $shelf,
446
    shelf    => $shelf,
447
    messages => \@messages,
447
    messages => \@messages,
448
    category => $category,
448
    public   => $public,
449
    print    => scalar $query->param('print') || 0,
449
    print    => scalar $query->param('print') || 0,
450
    listsview => 1,
450
    listsview => 1,
451
);
451
);
(-)a/svc/virtualshelves/search (-5 / +5 lines)
Lines 22-28 my ($template, $user, $cookie) = get_template_and_user({ Link Here
22
my $shelfname = $input->param('shelfname');
22
my $shelfname = $input->param('shelfname');
23
my $count = $input->param('count');
23
my $count = $input->param('count');
24
my $owner = $input->param('owner');
24
my $owner = $input->param('owner');
25
my $type = $input->param('type');
25
my $public = $input->param('public');
26
my $sortby = $input->param('sortby');
26
my $sortby = $input->param('sortby');
27
27
28
# variable information for DataTables (id)
28
# variable information for DataTables (id)
Lines 36-45 foreach (grep {$_ =~ /^mDataProp/} keys %dt_params) { Link Here
36
my $results = C4::Utils::DataTables::VirtualShelves::search(
36
my $results = C4::Utils::DataTables::VirtualShelves::search(
37
    {
37
    {
38
        shelfname => $shelfname,
38
        shelfname => $shelfname,
39
        count => $count,
39
        count     => $count,
40
        owner => $owner,
40
        owner     => $owner,
41
        type => $type,
41
        public    => $public,
42
        sortby => $sortby,
42
        sortby    => $sortby,
43
        dt_params => \%dt_params,
43
        dt_params => \%dt_params,
44
    }
44
    }
45
);
45
);
(-)a/t/db_dependent/Utils/Datatables_Virtualshelves.t (-10 / +10 lines)
Lines 87-93 $john_smith{borrowernumber} = Koha::Patron->new( \%john_smith )->store->borrower Link Here
87
my $shelf1 = Koha::Virtualshelf->new(
87
my $shelf1 = Koha::Virtualshelf->new(
88
    {
88
    {
89
        shelfname => 'my first private list (empty)',
89
        shelfname => 'my first private list (empty)',
90
        category  => 1, # private
90
        public    => 0,
91
        sortfield => 'author',
91
        sortfield => 'author',
92
        owner     => $john_doe{borrowernumber},
92
        owner     => $john_doe{borrowernumber},
93
    }
93
    }
Lines 96-102 my $shelf1 = Koha::Virtualshelf->new( Link Here
96
my $shelf2 = Koha::Virtualshelf->new(
96
my $shelf2 = Koha::Virtualshelf->new(
97
    {
97
    {
98
        shelfname => 'my second private list',
98
        shelfname => 'my second private list',
99
        category  => 1, # private
99
        public    => 0,
100
        sortfield => 'title',
100
        sortfield => 'title',
101
        owner     => $john_doe{borrowernumber},
101
        owner     => $john_doe{borrowernumber},
102
    }
102
    }
Lines 115-121 $shelf2->add_biblio( $biblionumber5, $john_doe{borrowernumber} ); Link Here
115
my $shelf3 = Koha::Virtualshelf->new(
115
my $shelf3 = Koha::Virtualshelf->new(
116
    {
116
    {
117
        shelfname => 'The first public list',
117
        shelfname => 'The first public list',
118
        category  => 2, # public
118
        public    => 1,
119
        sortfield => 'author',
119
        sortfield => 'author',
120
        owner     => $jane_doe{borrowernumber},
120
        owner     => $jane_doe{borrowernumber},
121
    }
121
    }
Lines 130-136 $shelf3->add_biblio( $biblionumber8, $jane_doe{borrowernumber} ); Link Here
130
my $shelf4 = Koha::Virtualshelf->new(
130
my $shelf4 = Koha::Virtualshelf->new(
131
    {
131
    {
132
        shelfname => 'my second public list',
132
        shelfname => 'my second public list',
133
        category  => 2, # public
133
        public    => 1,
134
        sortfield => 'title',
134
        sortfield => 'title',
135
        owner     => $jane_doe{borrowernumber},
135
        owner     => $jane_doe{borrowernumber},
136
    }
136
    }
Lines 147-153 $shelf3->add_biblio( $biblionumber12, $jane_doe{borrowernumber} ); Link Here
147
my $shelf5 = Koha::Virtualshelf->new(
147
my $shelf5 = Koha::Virtualshelf->new(
148
    {
148
    {
149
        shelfname => 'my third private list',
149
        shelfname => 'my third private list',
150
        category  => 1, # private
150
        public    => 0,
151
        sortfield => 'title',
151
        sortfield => 'title',
152
        owner     => $jane_doe{borrowernumber},
152
        owner     => $jane_doe{borrowernumber},
153
    }
153
    }
Lines 169-175 for my $i ( 6 .. 15 ) { Link Here
169
    Koha::Virtualshelf->new(
169
    Koha::Virtualshelf->new(
170
        {
170
        {
171
            shelfname => "another public list $i",
171
            shelfname => "another public list $i",
172
            category  => 2,
172
            public    => 1,
173
            owner     => $john_smith{borrowernumber},
173
            owner     => $john_smith{borrowernumber},
174
        }
174
        }
175
    )->store;
175
    )->store;
Lines 188-194 t::lib::Mocks::mock_userenv({ patron => $john_doe_patron }); Link Here
188
$search_results = C4::Utils::DataTables::VirtualShelves::search({
188
$search_results = C4::Utils::DataTables::VirtualShelves::search({
189
    shelfname => "ist",
189
    shelfname => "ist",
190
    dt_params => \%dt_params,
190
    dt_params => \%dt_params,
191
    type => 1,
191
    public    => 0,
192
});
192
});
193
193
194
is( $search_results->{ iTotalRecords }, 2,
194
is( $search_results->{ iTotalRecords }, 2,
Lines 203-209 is( @{ $search_results->{ shelves } }, 2, Link Here
203
# Search by type only
203
# Search by type only
204
$search_results = C4::Utils::DataTables::VirtualShelves::search({
204
$search_results = C4::Utils::DataTables::VirtualShelves::search({
205
    dt_params => \%dt_params,
205
    dt_params => \%dt_params,
206
    type => 2,
206
    public    => 1,
207
});
207
});
208
is( $search_results->{ iTotalRecords }, 12,
208
is( $search_results->{ iTotalRecords }, 12,
209
    "There should be 12 public shelves in total" );
209
    "There should be 12 public shelves in total" );
Lines 218-224 is( @{ $search_results->{ shelves } }, 10, Link Here
218
$search_results = C4::Utils::DataTables::VirtualShelves::search({
218
$search_results = C4::Utils::DataTables::VirtualShelves::search({
219
    owner => "jane",
219
    owner => "jane",
220
    dt_params => \%dt_params,
220
    dt_params => \%dt_params,
221
    type => 2,
221
    public    => 1,
222
});
222
});
223
is( $search_results->{ iTotalRecords }, 12,
223
is( $search_results->{ iTotalRecords }, 12,
224
    "There should be 12 public shelves in total" );
224
    "There should be 12 public shelves in total" );
Lines 234-240 $search_results = C4::Utils::DataTables::VirtualShelves::search({ Link Here
234
    owner => "smith",
234
    owner => "smith",
235
    shelfname => "public list 1",
235
    shelfname => "public list 1",
236
    dt_params => \%dt_params,
236
    dt_params => \%dt_params,
237
    type => 2,
237
    public    => 1,
238
});
238
});
239
is( $search_results->{ iTotalRecords }, 12,
239
is( $search_results->{ iTotalRecords }, 12,
240
    "There should be 12 public shelves in total" );
240
    "There should be 12 public shelves in total" );
(-)a/t/db_dependent/Virtualshelves.t (-16 / +16 lines)
Lines 34-40 subtest 'CRUD' => sub { Link Here
34
    my $shelf = Koha::Virtualshelf->new({
34
    my $shelf = Koha::Virtualshelf->new({
35
            shelfname => "my first shelf",
35
            shelfname => "my first shelf",
36
            owner => $patron->{borrowernumber},
36
            owner => $patron->{borrowernumber},
37
            category => 1,
37
            public => 0,
38
        }
38
        }
39
    )->store;
39
    )->store;
40
40
Lines 61-67 subtest 'CRUD' => sub { Link Here
61
        $shelf = Koha::Virtualshelf->new({
61
        $shelf = Koha::Virtualshelf->new({
62
                shelfname => "my first shelf",
62
                shelfname => "my first shelf",
63
                owner => $patron->{borrowernumber},
63
                owner => $patron->{borrowernumber},
64
                category => 1,
64
                public => 0,
65
            }
65
            }
66
        )->store;
66
        )->store;
67
    };
67
    };
Lines 77-83 subtest 'CRUD' => sub { Link Here
77
    $shelf = Koha::Virtualshelf->new({
77
    $shelf = Koha::Virtualshelf->new({
78
            shelfname => "my first shelf",
78
            shelfname => "my first shelf",
79
            owner => $another_patron->{borrowernumber},
79
            owner => $another_patron->{borrowernumber},
80
            category => 1,
80
            public => 0,
81
        }
81
        }
82
    )->store;
82
    )->store;
83
    $number_of_shelves = Koha::Virtualshelves->search->count;
83
    $number_of_shelves = Koha::Virtualshelves->search->count;
Lines 109-122 subtest 'Sharing' => sub { Link Here
109
    my $shelf_to_share = Koha::Virtualshelf->new({
109
    my $shelf_to_share = Koha::Virtualshelf->new({
110
            shelfname => "my first shelf",
110
            shelfname => "my first shelf",
111
            owner => $patron_wants_to_share->{borrowernumber},
111
            owner => $patron_wants_to_share->{borrowernumber},
112
            category => 1,
112
            public => 0,
113
        }
113
        }
114
    )->store;
114
    )->store;
115
115
116
    my $shelf_not_to_share = Koha::Virtualshelf->new({
116
    my $shelf_not_to_share = Koha::Virtualshelf->new({
117
            shelfname => "my second shelf",
117
            shelfname => "my second shelf",
118
            owner => $patron_wants_to_share->{borrowernumber},
118
            owner => $patron_wants_to_share->{borrowernumber},
119
            category => 1,
119
            public => 0,
120
        }
120
        }
121
    )->store;
121
    )->store;
122
122
Lines 186-192 subtest 'Shelf content' => sub { Link Here
186
    my $shelf = Koha::Virtualshelf->new(
186
    my $shelf = Koha::Virtualshelf->new(
187
        {   shelfname    => "my first shelf",
187
        {   shelfname    => "my first shelf",
188
            owner        => $patron1->{borrowernumber},
188
            owner        => $patron1->{borrowernumber},
189
            category     => 1,
189
            public       => 0,
190
            lastmodified => $dt_yesterday,
190
            lastmodified => $dt_yesterday,
191
        }
191
        }
192
    )->store;
192
    )->store;
Lines 263-269 subtest 'Shelf permissions' => sub { Link Here
263
    my $public_shelf = Koha::Virtualshelf->new(
263
    my $public_shelf = Koha::Virtualshelf->new(
264
        {   shelfname    => "my first shelf",
264
        {   shelfname    => "my first shelf",
265
            owner        => $patron1->{borrowernumber},
265
            owner        => $patron1->{borrowernumber},
266
            category     => 2,
266
            public       => 1,
267
            allow_change_from_owner => 0,
267
            allow_change_from_owner => 0,
268
            allow_change_from_others => 0,
268
            allow_change_from_others => 0,
269
        }
269
        }
Lines 307-313 subtest 'Shelf permissions' => sub { Link Here
307
    my $private_shelf = Koha::Virtualshelf->new(
307
    my $private_shelf = Koha::Virtualshelf->new(
308
        {   shelfname    => "my first shelf",
308
        {   shelfname    => "my first shelf",
309
            owner        => $patron1->{borrowernumber},
309
            owner        => $patron1->{borrowernumber},
310
            category     => 1,
310
            public       => 0,
311
            allow_change_from_owner => 0,
311
            allow_change_from_owner => 0,
312
            allow_change_from_others => 0,
312
            allow_change_from_others => 0,
313
        }
313
        }
Lines 363-393 subtest 'Get shelves' => sub { Link Here
363
    my $private_shelf1_1 = Koha::Virtualshelf->new({
363
    my $private_shelf1_1 = Koha::Virtualshelf->new({
364
            shelfname => "private shelf 1 for patron 1",
364
            shelfname => "private shelf 1 for patron 1",
365
            owner => $patron1->{borrowernumber},
365
            owner => $patron1->{borrowernumber},
366
            category => 1,
366
            public => 0,
367
        }
367
        }
368
    )->store;
368
    )->store;
369
    my $private_shelf1_2 = Koha::Virtualshelf->new({
369
    my $private_shelf1_2 = Koha::Virtualshelf->new({
370
            shelfname => "private shelf 2 for patron 1",
370
            shelfname => "private shelf 2 for patron 1",
371
            owner => $patron1->{borrowernumber},
371
            owner => $patron1->{borrowernumber},
372
            category => 1,
372
            public => 0,
373
        }
373
        }
374
    )->store;
374
    )->store;
375
    my $private_shelf2_1 = Koha::Virtualshelf->new({
375
    my $private_shelf2_1 = Koha::Virtualshelf->new({
376
            shelfname => "private shelf 1 for patron 2",
376
            shelfname => "private shelf 1 for patron 2",
377
            owner => $patron2->{borrowernumber},
377
            owner => $patron2->{borrowernumber},
378
            category => 1,
378
            public => 0,
379
        }
379
        }
380
    )->store;
380
    )->store;
381
    my $public_shelf1_1 = Koha::Virtualshelf->new({
381
    my $public_shelf1_1 = Koha::Virtualshelf->new({
382
            shelfname => "public shelf 1 for patron 1",
382
            shelfname => "public shelf 1 for patron 1",
383
            owner => $patron1->{borrowernumber},
383
            owner => $patron1->{borrowernumber},
384
            category => 2,
384
            public => 1,
385
        }
385
        }
386
    )->store;
386
    )->store;
387
    my $public_shelf1_2 = Koha::Virtualshelf->new({
387
    my $public_shelf1_2 = Koha::Virtualshelf->new({
388
            shelfname => "public shelf 2 for patron 1",
388
            shelfname => "public shelf 2 for patron 1",
389
            owner => $patron1->{borrowernumber},
389
            owner => $patron1->{borrowernumber},
390
            category => 2,
390
            public => 1,
391
        }
391
        }
392
    )->store;
392
    )->store;
393
393
Lines 419-437 subtest 'Get shelves containing biblios' => sub { Link Here
419
    my $shelf1 = Koha::Virtualshelf->new(
419
    my $shelf1 = Koha::Virtualshelf->new(
420
        {   shelfname    => "my first shelf",
420
        {   shelfname    => "my first shelf",
421
            owner        => $patron1->{borrowernumber},
421
            owner        => $patron1->{borrowernumber},
422
            category     => 1,
422
            public       => 0,
423
        }
423
        }
424
    )->store;
424
    )->store;
425
    my $shelf2 = Koha::Virtualshelf->new(
425
    my $shelf2 = Koha::Virtualshelf->new(
426
        {   shelfname    => "my x second shelf", # 'x' to make it sorted after 'third'
426
        {   shelfname    => "my x second shelf", # 'x' to make it sorted after 'third'
427
            owner        => $patron2->{borrowernumber},
427
            owner        => $patron2->{borrowernumber},
428
            category     => 1,
428
            public       => 0,
429
        }
429
        }
430
    )->store;
430
    )->store;
431
    my $shelf3 = Koha::Virtualshelf->new(
431
    my $shelf3 = Koha::Virtualshelf->new(
432
        {   shelfname    => "my third shelf",
432
        {   shelfname    => "my third shelf",
433
            owner        => $patron1->{borrowernumber},
433
            owner        => $patron1->{borrowernumber},
434
            category     => 2,
434
            public       => 1,
435
        }
435
        }
436
    )->store;
436
    )->store;
437
437
(-)a/virtualshelves/shelves.pl (-10 / +9 lines)
Lines 52-60 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
52
    }
52
    }
53
);
53
);
54
54
55
my $op       = $query->param('op')       || 'list';
55
my $op       = $query->param('op')      || 'list';
56
my $referer  = $query->param('referer')  || $op;
56
my $referer  = $query->param('referer') || $op;
57
my $category = $query->param('category') || 1;
57
my $public   = $query->param('public') ? 1 : 0;
58
my ( $shelf, $shelfnumber, @messages );
58
my ( $shelf, $shelfnumber, @messages );
59
59
60
if ( $op eq 'add_form' ) {
60
if ( $op eq 'add_form' ) {
Lines 65-71 if ( $op eq 'add_form' ) { Link Here
65
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
65
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
66
66
67
    if ( $shelf ) {
67
    if ( $shelf ) {
68
        $category = $shelf->category;
68
        $public = $shelf->public;
69
        my $patron = Koha::Patrons->find( $shelf->owner )->unblessed;
69
        my $patron = Koha::Patrons->find( $shelf->owner )->unblessed;
70
        $template->param( owner => $patron, );
70
        $template->param( owner => $patron, );
71
        unless ( $shelf->can_be_managed( $loggedinuser ) ) {
71
        unless ( $shelf->can_be_managed( $loggedinuser ) ) {
Lines 81-87 if ( $op eq 'add_form' ) { Link Here
81
        $shelf = Koha::Virtualshelf->new(
81
        $shelf = Koha::Virtualshelf->new(
82
            {   shelfname          => scalar $query->param('shelfname'),
82
            {   shelfname          => scalar $query->param('shelfname'),
83
                sortfield          => scalar $query->param('sortfield'),
83
                sortfield          => scalar $query->param('sortfield'),
84
                category           => scalar $query->param('category'),
84
                public             => $public,
85
                allow_change_from_owner => $allow_changes_from > 0,
85
                allow_change_from_owner => $allow_changes_from > 0,
86
                allow_change_from_others => $allow_changes_from == ANYONE,
86
                allow_change_from_others => $allow_changes_from == ANYONE,
87
                owner              => scalar $query->param('owner'),
87
                owner              => scalar $query->param('owner'),
Lines 113-119 if ( $op eq 'add_form' ) { Link Here
113
            my $allow_changes_from = $query->param('allow_changes_from');
113
            my $allow_changes_from = $query->param('allow_changes_from');
114
            $shelf->allow_change_from_owner( $allow_changes_from > 0 );
114
            $shelf->allow_change_from_owner( $allow_changes_from > 0 );
115
            $shelf->allow_change_from_others( $allow_changes_from == ANYONE );
115
            $shelf->allow_change_from_others( $allow_changes_from == ANYONE );
116
            $shelf->category( scalar $query->param('category') );
116
            $shelf->public( scalar $query->param('public') );
117
            eval { $shelf->store };
117
            eval { $shelf->store };
118
118
119
            if ($@) {
119
            if ($@) {
Lines 310-323 if ( $op eq 'view' ) { Link Here
310
                {
310
                {
311
                    borrowernumber => $loggedinuser,
311
                    borrowernumber => $loggedinuser,
312
                    add_allowed    => 1,
312
                    add_allowed    => 1,
313
                    category       => 1,
313
                    public         => 0,
314
                }
314
                }
315
            );
315
            );
316
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
316
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
317
                {
317
                {
318
                    borrowernumber => $loggedinuser,
318
                    borrowernumber => $loggedinuser,
319
                    add_allowed    => 1,
319
                    add_allowed    => 1,
320
                    category       => 2,
320
                    public         => 1,
321
                }
321
                }
322
            );
322
            );
323
323
Lines 356-362 $template->param( Link Here
356
    referer  => $referer,
356
    referer  => $referer,
357
    shelf    => $shelf,
357
    shelf    => $shelf,
358
    messages => \@messages,
358
    messages => \@messages,
359
    category => $category,
359
    public   => $public,
360
    print    => scalar $query->param('print') || 0,
360
    print    => scalar $query->param('print') || 0,
361
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ],
361
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ],
362
);
362
);
363
- 

Return to bug 28959