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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (+3 lines)
Lines 531-536 Link Here
531
                        },{
531
                        },{
532
                            'name': 'template_path',
532
                            'name': 'template_path',
533
                            'value': 'virtualshelves/tables/shelves_results.tt',
533
                            'value': 'virtualshelves/tables/shelves_results.tt',
534
                        },{
535
                            'name': 'allow_transfer',
536
                            'value': '[% allow_transfer | html %]',
534
                        },{
537
                        },{
535
                            'name': 'shelfname_sorton',
538
                            'name': 'shelfname_sorton',
536
                            'value': 'vs.shelfname',
539
                            'value': 'vs.shelfname',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt (-1 / +11 lines)
Lines 46-52 Link Here
46
        [%~ 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 _ '<button class="editshelf btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</button>' ~%]
47
        [%~ action_block = action_block _ '</form> ' ~%]
47
        [%~ action_block = action_block _ '</form> ' ~%]
48
    [%~ END ~%]
48
    [%~ END ~%]
49
    [%~ IF can_manage_shelf OR can_delete_shelf ~%]
49
    [%~ IF can_delete_shelf ~%]
50
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
50
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
Lines 56-61 Link Here
56
        [%~ 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 _ '<button type="submit" class="deleteshelf btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>' ~%]
57
        [%~ action_block = action_block _ '</form>' ~%]
57
        [%~ action_block = action_block _ '</form>' ~%]
58
    [%~ END ~%]
58
    [%~ END ~%]
59
    [%~ IF public AND allow_transfer ~%]
60
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
61
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
62
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="transfer" />' ~%]
63
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
64
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="1" />' ~%]
65
        [%~ action_block = action_block _ '<input type="hidden" name="referer" value="list" />' ~%]
66
        [%~ action_block = action_block _ '<button type="submit" class="btn btn-default btn-xs"><i class="fa"></i> Transfer</button>' ~%]
67
        [%~ action_block = action_block _ '</form>' ~%]
68
    [%~ END ~%]
59
[%~ ELSE ~%]
69
[%~ ELSE ~%]
60
    [%~ SET action_block = 'None' ~%]
70
    [%~ SET action_block = 'None' ~%]
61
[%~ END ~%]
71
[%~ END ~%]
(-)a/svc/virtualshelves/search (-1 / +4 lines)
Lines 24-29 my $count = $input->param('count'); Link Here
24
my $owner = $input->param('owner');
24
my $owner = $input->param('owner');
25
my $public = $input->param('public');
25
my $public = $input->param('public');
26
my $sortby = $input->param('sortby');
26
my $sortby = $input->param('sortby');
27
my $allow_transfer = $input->param('allow_transfer');
27
28
28
# variable information for DataTables (id)
29
# variable information for DataTables (id)
29
my $sEcho = $input->param('sEcho');
30
my $sEcho = $input->param('sEcho');
Lines 48-54 $template->param( Link Here
48
    sEcho => $sEcho,
49
    sEcho => $sEcho,
49
    iTotalRecords => $results->{iTotalRecords},
50
    iTotalRecords => $results->{iTotalRecords},
50
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
51
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
51
    aaData => $results->{shelves}
52
    aaData => $results->{shelves},
53
    public => $public,
54
    allow_transfer => $allow_transfer,
52
);
55
);
53
56
54
output_with_http_headers $input, $cookie, $template->output, 'json';
57
output_with_http_headers $input, $cookie, $template->output, 'json';
(-)a/virtualshelves/shelves.pl (-3 / +6 lines)
Lines 19-26 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use CGI qw ( -utf8 );
21
use CGI qw ( -utf8 );
22
use C4::Auth qw( get_template_and_user );
22
use C4::Auth qw( get_template_and_user haspermission );
23
use C4::Biblio qw( GetMarcBiblio );
23
use C4::Biblio qw( GetMarcBiblio );
24
use C4::Context;
24
use C4::Koha qw(
25
use C4::Koha qw(
25
    GetNormalizedEAN
26
    GetNormalizedEAN
26
    GetNormalizedISBN
27
    GetNormalizedISBN
Lines 56-62 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
56
my $op       = $query->param('op')      || 'list';
57
my $op       = $query->param('op')      || 'list';
57
my $referer  = $query->param('referer') || $op;
58
my $referer  = $query->param('referer') || $op;
58
my $public   = $query->param('public') ? 1 : 0;
59
my $public   = $query->param('public') ? 1 : 0;
59
my ( $shelf, $shelfnumber, @messages );
60
my ( $shelf, $shelfnumber, @messages, $allow_transfer );
60
61
61
if ( $op eq 'add_form' ) {
62
if ( $op eq 'add_form' ) {
62
    # Only pass default
63
    # Only pass default
Lines 352-357 if ( $op eq 'view' ) { Link Here
352
    } else {
353
    } else {
353
        push @messages, { type => 'alert', code => 'does_not_exist' };
354
        push @messages, { type => 'alert', code => 'does_not_exist' };
354
    }
355
    }
356
} elsif( $op eq 'list' ) {
357
    $allow_transfer = haspermission( C4::Context->userenv->{id}, { lists => 'edit_public_lists' } ) ? 1 : 0;
355
}
358
}
356
359
357
$template->param(
360
$template->param(
Lines 362-367 $template->param( Link Here
362
    public   => $public,
365
    public   => $public,
363
    print    => scalar $query->param('print') || 0,
366
    print    => scalar $query->param('print') || 0,
364
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' })->as_list ],
367
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' })->as_list ],
368
    allow_transfer => $allow_transfer,
365
);
369
);
366
370
367
output_html_with_http_headers $query, $cookie, $template->output;
371
output_html_with_http_headers $query, $cookie, $template->output;
368
- 

Return to bug 25498