Bug 30937: Add a 'does not exist' hint if branchcode is invalid
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 16 Jun 2022 13:24:59 +0000 (15:24 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Jun 2022 15:35:27 +0000 (12:35 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

index 5fdda101dddbb28ed97e73564437848ce551c51b..a30b21af4e3af581194313a6411cb8d6122944a2 100644 (file)
@@ -130,7 +130,7 @@ Libraries &rsaquo; Administration &rsaquo; Koha
 [% IF op == 'list' || op == 'view' %]
     <div id="toolbar" class="btn-toolbar">
         <a class="btn btn-default" id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form"><i class="fa fa-plus"></i> New library</a>
-        [% IF op == 'view' %]
+        [% IF op == 'view' && library %]
             <a class="btn btn-default" id="editbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=[% library.branchcode | uri %]"><i class="fa fa-pencil"></i> Edit library</a>
         [% END %]
     </div>
@@ -337,7 +337,7 @@ Libraries &rsaquo; Administration &rsaquo; Koha
     [% END %]
 [% END %]
 
-[% IF op == 'view' %]
+[% IF op == 'view' && library %]
     <h1>[% library.branchname | html %]</h1>
     <div class="row">
         <div class="col-sm-6">
@@ -470,6 +470,8 @@ Libraries &rsaquo; Administration &rsaquo; Koha
             </div>
         </div>
     [% END %]
+[% ELSIF op == 'view' %]
+    <div>This library does not exist.</div>
 [% END %]
 
             </main>