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 (-5 / +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';
Lines 63-72 search - a search script for finding virtual shelves Link Here
63
66
64
This script provides a service for template for virtual shelves search using DataTables
67
This script provides a service for template for virtual shelves search using DataTables
65
68
66
=cut
67
68
=back
69
70
=head1 LICENSE
69
=head1 LICENSE
71
70
72
Copyright 2014 BibLibre
71
Copyright 2014 BibLibre
(-)a/virtualshelves/shelves.pl (-3 / +6 lines)
Lines 19-27 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::Circulation qw( barcodedecode );
24
use C4::Circulation qw( barcodedecode );
25
use C4::Context;
25
use C4::Koha qw(
26
use C4::Koha qw(
26
    GetNormalizedEAN
27
    GetNormalizedEAN
27
    GetNormalizedISBN
28
    GetNormalizedISBN
Lines 57-63 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
57
my $op       = $query->param('op')      || 'list';
58
my $op       = $query->param('op')      || 'list';
58
my $referer  = $query->param('referer') || $op;
59
my $referer  = $query->param('referer') || $op;
59
my $public   = $query->param('public') ? 1 : 0;
60
my $public   = $query->param('public') ? 1 : 0;
60
my ( $shelf, $shelfnumber, @messages );
61
my ( $shelf, $shelfnumber, @messages, $allow_transfer );
61
62
62
if ( $op eq 'add_form' ) {
63
if ( $op eq 'add_form' ) {
63
    # Only pass default
64
    # Only pass default
Lines 353-358 if ( $op eq 'view' ) { Link Here
353
    } else {
354
    } else {
354
        push @messages, { type => 'alert', code => 'does_not_exist' };
355
        push @messages, { type => 'alert', code => 'does_not_exist' };
355
    }
356
    }
357
} elsif( $op eq 'list' ) {
358
    $allow_transfer = haspermission( C4::Context->userenv->{id}, { lists => 'edit_public_lists' } ) ? 1 : 0;
356
}
359
}
357
360
358
$template->param(
361
$template->param(
Lines 363-368 $template->param( Link Here
363
    public   => $public,
366
    public   => $public,
364
    print    => scalar $query->param('print') || 0,
367
    print    => scalar $query->param('print') || 0,
365
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' })->as_list ],
368
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' })->as_list ],
369
    allow_transfer => $allow_transfer,
366
);
370
);
367
371
368
output_html_with_http_headers $query, $cookie, $template->output;
372
output_html_with_http_headers $query, $cookie, $template->output;
369
- 

Return to bug 25498