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

(-)a/admin/branches.pl (+1 lines)
Lines 84-89 if ( $op eq 'add_form' ) { Link Here
84
      opac_info
84
      opac_info
85
      marcorgcode
85
      marcorgcode
86
      pickup_location
86
      pickup_location
87
      public
87
    );
88
    );
88
    my $is_a_modif = $input->param('is_a_modif');
89
    my $is_a_modif = $input->param('is_a_modif');
89
90
(-)a/api/v1/swagger/definitions/library.json (+4 lines)
Lines 88-93 Link Here
88
        "type": "boolean",
88
        "type": "boolean",
89
        "description": "If the library can act as a pickup location"
89
        "description": "If the library can act as a pickup location"
90
    },
90
    },
91
    "public": {
92
        "type": "boolean",
93
        "description": "If the library is visible to the public"
94
    },
91
    "smtp_server": {
95
    "smtp_server": {
92
        "type": ["object", "null"],
96
        "type": ["object", "null"],
93
        "description": "The library effective SMTP server"
97
        "description": "The library effective SMTP server"
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt (+19 lines)
Lines 265-270 Libraries › Administration › Koha Link Here
265
                        [% END %]
265
                        [% END %]
266
                    </select>
266
                    </select>
267
                </li>
267
                </li>
268
                <li><label for="public">Public: </label>
269
                    <select name="public" id="public">
270
                        [% IF !library || library.public == 1 %]
271
                        <option value="1" selected="selected">Yes</option>
272
                        <option value="0">No</option>
273
                        [% ELSE %]
274
                        <option value="1">Yes</option>
275
                        <option value="0" selected="selected">No</option>
276
                        [% END %]
277
                    </select>
278
                </li>
268
            </ol>
279
            </ol>
269
        </fieldset>
280
        </fieldset>
270
        <fieldset class="action">
281
        <fieldset class="action">
Lines 301-306 Libraries &rsaquo; Administration &rsaquo; Koha Link Here
301
                    <th>MARC organization code</th>
312
                    <th>MARC organization code</th>
302
                    <th>IP</th>
313
                    <th>IP</th>
303
                    <th>Pickup location</th>
314
                    <th>Pickup location</th>
315
                    <th>Public</th>
304
                    <th>SMTP server</th>
316
                    <th>SMTP server</th>
305
                    <th data-class-name="actions noExport">Actions</th>
317
                    <th data-class-name="actions noExport">Actions</th>
306
                </tr>
318
                </tr>
Lines 409-414 Libraries &rsaquo; Administration &rsaquo; Koha Link Here
409
                        "render": function( data, type, row, meta ) {
421
                        "render": function( data, type, row, meta ) {
410
                            return (data) ? _("Yes") : _("No");
422
                            return (data) ? _("Yes") : _("No");
411
                        }
423
                        }
424
                    },                    {
425
                        "data": "public",
426
                        "searchable": true,
427
                        "orderable": true,
428
                        "render": function( data, type, row, meta ) {
429
                            return (data) ? _("Yes") : _("No");
430
                        }
412
                    },
431
                    },
413
                    {
432
                    {
414
                        "data": "smtp_server",
433
                        "data": "smtp_server",
(-)a/opac/opac-library.pl (-11 / +16 lines)
Lines 17-23 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
21
use Modern::Perl;
20
use Modern::Perl;
22
21
23
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
Lines 27-33 use Koha::Libraries; Link Here
27
26
28
my $query = CGI->new();
27
my $query = CGI->new();
29
28
30
my $branchcode   = $query->param('branchcode');
29
my $branchcode = $query->param('branchcode');
31
30
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
32
    {
Lines 38-52 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
38
    }
37
    }
39
);
38
);
40
39
41
if( $branchcode ){
40
my $found;
42
    my $library = Koha::Libraries->find( $branchcode );
41
if ($branchcode) {
43
    $template->param( library => $library );
42
    my $library = Koha::Libraries->find($branchcode);
43
    if ( $library->public ) {
44
        $found++;
45
        $template->param( library => $library );
46
    }
44
}
47
}
45
48
46
my $libraries = Koha::Libraries->search( {}, { order_by => ['branchname'] }, );
49
unless ($found) {
47
$template->param(
50
    my $libraries = Koha::Libraries->search( { public => 1 }, { order_by => ['branchname'] } );
48
    libraries => $libraries,
51
49
    branchcode => $branchcode,
52
    $template->param(
50
);
53
        libraries  => $libraries,
54
        branchcode => $branchcode,
55
    );
56
}
51
57
52
output_html_with_http_headers $query, $cookie, $template->output;
58
output_html_with_http_headers $query, $cookie, $template->output;
53
- 

Return to bug 27360