Bug 6323 -- Error handling cleanup for moveitem.tt
authorLiz Rea <lrea@nekls.org>
Wed, 28 Sep 2011 14:04:14 +0000 (09:04 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 3 Feb 2012 14:18:02 +0000 (15:18 +0100)
Added button to retry attaching item, added default bib view handling, cosmetic changes to the error display (buttons now in error div).

Incorporates changes that should satisfy QA.

To test:
Find a bib with multiple items and grab one of the barcodes.
Go to a second bib and click Edit -> Attach item
Paste your barcode in there and click "Submit"
Click the "Try again with a different barcode" button. It should take you back to the barcode entry screen.

Also try with a non-existent barcode and verify that the button appears and works as intended.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt

index 553d130..78b8579 100644 (file)
@@ -5,46 +5,72 @@
 <body>
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloging/addbooks.pl">Cataloging</a>  &rsaquo; Attach an item to <i>[% bibliotitle |html %]</i></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloging/addbooks.pl">Cataloging</a>  &rsaquo; Attach an item to <i>[% bibliotitle |html %][% IF ( itemsloo.subtitle ) %][% itemsloo.subtitle %][% END %]</i></div>
 <div id="doc" class="yui-t7">
 
+[% BLOCK actions %]
+                        [% IF ( BiblioDefaultViewmarc ) %]
+                             <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
+                        [% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
+                             <form action="/cgi-bin/koha/catalogue/labeledMARCdetail.pl" method="post">
+                        [% ELSIF ( BiblioDefaultViewisbd ) %]
+                             <form action="/cgi-bin/koha/catalogue/ISBDdetail.pl" method="post">
+                        [% ELSE %]
+                             <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
+                        [% END %]
+[% END %]
+
+[% BLOCK fail %]
+                                <input type="submit" class="approve" value="OK" />
+                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                        </form>
+                                <form method="get" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">
+                                <input type="submit" class="new" value="Try again with a different barcode"/>
+                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                        </form>
+[% END %]
+
 [% IF ( error ) %]
     <div class="dialog alert">
-       [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.[% END %]
-       [% IF ( errornoitem ) %]ERROR: Unable to get the item.[% END %]
-       [% IF ( errornoitemnumber ) %]ERROR: Unable to get the item number from this barcode.[% END %]
+
+               [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.<p>
+                       [% INCLUDE actions %]
+                       [% INCLUDE fail %]
+               [% END %]
+
+               [% IF ( errornoitem ) %]ERROR: Unable to get the item.<p>
+                       [% INCLUDE actions %]
+                       [% INCLUDE fail %]
+               [% END %]
+
+               [% IF ( errornoitemnumber ) %]ERROR: Unable to get the item number from this barcode.<p>
+                       [% INCLUDE actions %]
+                       [% INCLUDE fail %]
+               [% END %]
+               </p>
     </div>
-    <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
-       <input type="submit" value="OK" />
-       <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-    </form>
-[% ELSE %]
-    [% IF ( success ) %]
-       <div class="dialog message">The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %]<i>[% bibliotitle |html %]</i></a>.[% IF ( BiblioDefaultViewmarc ) %]
-       <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
-[% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
-       <form action="/cgi-bin/koha/catalogue/labeledMARCdetail.pl" method="post">
-[% ELSIF ( BiblioDefaultViewisbd ) %]
-       <form action="/cgi-bin/koha/catalogue/ISBDdetail.pl" method="post">
-[% ELSE %]
-       <form method="link" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]"/>
-[% END %]
-           <input type="submit" class="attachanother" value="Attach Another Item"/>
-           <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-       </form>
-       <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
-           <input type="submit"  class="approve" value="OK" />
-           <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-       </form>
-</div>
 
+       [% ELSE %]
+           [% IF ( success ) %]
+                       <div class="dialog message">The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %]<i>[% bibliotitle |html %]</i></a>.
+                       <p>
+                       [% INCLUDE actions %]
+                               <input type="submit" class="approve" value="OK" />
+                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                        </form>
+                                <form method="get" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]"/>
+                                <input type="submit" class="new" value="Attach another item"/>
+                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                        </form>
+                       </p>
+                       </div>
     [% ELSE %]
        [% IF ( missingparameter ) %]
        <form method="post" action="/cgi-bin/koha/cataloguing/moveitem.pl">
            [% IF ( missingbiblionumber ) %]
            <fieldset id="biblionumber_fieldset">
                <label for="biblionumber">Select the biblionumber to attach the item to</label>
-                   <div class="hint">Enter biblionumber:</div>
+                       <div class="hint">Enter biblionumber:</div>
                    <input type="text" name="biblionumber" id="biblionumber" class="focus" size="14" />
                    <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
            </fieldset>