@@ -, +, @@ --- admin/branches.pl | 1 + api/v1/swagger/definitions/library.json | 4 ++++ .../prog/en/modules/admin/branches.tt | 22 +++++++++++++++++- opac/opac-library.pl | 26 +++++++++++++--------- 4 files changed, 42 insertions(+), 11 deletions(-) --- a/admin/branches.pl +++ a/admin/branches.pl @@ -84,6 +84,7 @@ if ( $op eq 'add_form' ) { opac_info marcorgcode pickup_location + public ); my $is_a_modif = $input->param('is_a_modif'); --- a/api/v1/swagger/definitions/library.json +++ a/api/v1/swagger/definitions/library.json @@ -88,6 +88,10 @@ "type": "boolean", "description": "If the library can act as a pickup location" }, + "public": { + "type": "boolean", + "description": "If the library is visible to the public" + }, "smtp_server": { "type": ["object", "null"], "description": "The library effective SMTP server" --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -265,6 +265,17 @@ Libraries › Administration › Koha [% END %] +
  • + +
  • @@ -301,6 +312,7 @@ Libraries › Administration › Koha MARC organization code IP Pickup location + Public SMTP server Actions @@ -339,7 +351,7 @@ Libraries › Administration › Koha 'embed': [ 'smtp_server' ], 'emptyTable': '
    '+_("There are no libraries defined.")+' '+_("Start defining libraries")+'.
    ', "columnDefs": [ { - "targets": [0,1,3,4,6,8,9,10,11,12,13,14,15], + "targets": [0,1,3,4,7,9,10,11,12,13,14,15,16], "render": function (data, type, row, meta) { if ( type == 'display' ) { if ( data != null ) { @@ -411,6 +423,14 @@ Libraries › Administration › Koha } }, { + "data": "public", + "searchable": true, + "orderable": true, + "render": function( data, type, row, meta ) { + return (data) ? _("Yes") : _("No"); + } + }, + { "data": "smtp_server", "render": function( data, type, row, meta ) { if ( data.smtp_server_id ) { --- a/opac/opac-library.pl +++ a/opac/opac-library.pl @@ -17,7 +17,6 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . - use Modern::Perl; use CGI qw ( -utf8 ); @@ -27,7 +26,7 @@ use Koha::Libraries; my $query = CGI->new(); -my $branchcode = $query->param('branchcode'); +my $branchcode = $query->param('branchcode'); my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { @@ -38,15 +37,22 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -if( $branchcode ){ - my $library = Koha::Libraries->find( $branchcode ); - $template->param( library => $library ); +my $found; +if ($branchcode) { + my $library = Koha::Libraries->find($branchcode); + if ( $library->public ) { + $found++; + $template->param( library => $library ); + } } -my $libraries = Koha::Libraries->search( {}, { order_by => ['branchname'] }, ); -$template->param( - libraries => $libraries, - branchcode => $branchcode, -); +unless ($found) { + my $libraries = Koha::Libraries->search( { public => 1 }, { order_by => ['branchname'] } ); + + $template->param( + libraries => $libraries, + branchcode => $branchcode, + ); +} output_html_with_http_headers $query, $cookie, $template->output; --