[Koha-patches] [PATCH] Providing options for adding to order when existing record search has failed.

Owen Leonard oleonard at myacpl.org
Wed Dec 31 21:28:38 CET 2008


I've duplicated the "Add to Order" block on the search results page to display after a user has searched for an existing record to add to an order. This block is displayed whether or not results were found on the assumption that a non-empty result set may not contain the desired result. Changes to neworderbiblio.pl allow supplier name to appear in breadcrumb nav.
---
 acqui/neworderbiblio.pl                            |   20 +++++++++-----------
 .../intranet-tmpl/prog/en/css/staff-global.css     |    5 +++++
 .../prog/en/modules/acqui/basket.tmpl              |    8 ++++----
 .../prog/en/modules/acqui/neworderbiblio.tmpl      |   16 ++++++++++++++--
 4 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/acqui/neworderbiblio.pl b/acqui/neworderbiblio.pl
index 9682e75..824b664 100755
--- a/acqui/neworderbiblio.pl
+++ b/acqui/neworderbiblio.pl
@@ -76,6 +76,7 @@ my $results_per_page = $params->{'num'} || 20;
 my $booksellerid = $params->{'booksellerid'};
 my $basketno     = $params->{'basketno'};
 my $sub          = $params->{'sub'};
+my $bookseller = GetBookSellerFromId($booksellerid);
 
 # getting the template
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -92,8 +93,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 my ($error, $marcresults, $total_hits) = SimpleSearch($query, $results_per_page * ($page - 1), $results_per_page);
 
 if (defined $error) {
-    $template->param(query_error => $error);
     warn "error: ".$error;
+    $template->param(
+        query_error => $error,
+        basketno             => $basketno,
+        booksellerid     => $bookseller->{'id'},
+        name             => $bookseller->{'name'},
+    );
     output_html_with_http_headers $input, $cookie, $template->output;
     exit;
 }
@@ -114,19 +120,11 @@ foreach my $i ( 0 .. scalar @$marcresults ) {
 
 $template->param(
     basketno             => $basketno,
-    booksellerid         => $booksellerid,
+    booksellerid     => $bookseller->{'id'},
+    name             => $bookseller->{'name'},
     resultsloop          => \@results,
     total                => $total_hits,
     query                => $query,
-    virtualshelves       => C4::Context->preference("virtualshelves"),
-    LibraryName          => C4::Context->preference("LibraryName"),
-    OpacNav              => C4::Context->preference("OpacNav"),
-    opaccredits          => C4::Context->preference("opaccredits"),
-    AmazonContent        => C4::Context->preference("AmazonContent"),
-    opacsmallimage       => C4::Context->preference("opacsmallimage"),
-    opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
-    opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
-    "BiblioDefaultView".C4::Context->preference("IntranetBiblioDefaultView") => 1,
     pagination_bar       => pagination_bar( "$ENV{'SCRIPT_NAME'}?q=$query&booksellerid=$booksellerid&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ),
 );
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
index ee207b0..fa9eebc 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
@@ -1429,6 +1429,11 @@ input[type=reset]:active, input[type=button]:active, input.submit:active, button
 	border : 1px inset #999999;
 }
 
+ul li input.submit {
+	font-size : 87%;
+	padding : 2px;
+}
+
 .searchhighlightblob {
     font-size:75%;
 	font-style : italic;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
index e423e6d..79436b3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
@@ -157,18 +157,18 @@
     </div>
     <br />
     <!-- TMPL_UNLESS name="closedate" -->
-    <div id="acqui_basket_add">
-        <h2>Add To Order</h2>
+    <fieldset id="acqui_basket_add">
+        <legend>Add To Order</legend>
         <form action="/cgi-bin/koha/acqui/neworderbiblio.pl" method="post">
             <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
             <input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
             <ul><li><label for="q">From an existing record: </label><input id="q" type="text"  size="25" name="q" />
-            <input type="submit" value="Search" /></li>
+            <input type="submit" class="submit" value="Search" /></li>
             <li><a href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">From a Suggestion</a></li>
             <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">From a new (empty) record</a></li>
             </ul>
         </form>
-    </div>
+    </fieldset>
     <!-- /TMPL_UNLESS -->
 <!-- /TMPL_IF -->
 </div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl
index a5f0903..c600b8c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl
@@ -7,7 +7,7 @@
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; Search Existing Records</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR NAME="booksellerid" -->"><!-- TMPL_VAR NAME="name" --></a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?supplierid=<!-- TMPL_VAR NAME="booksellerid" -->">Add to Order</a> &rsaquo; Search Existing Records</div>
 
 <div id="doc3" class="yui-t2">
    
@@ -26,7 +26,6 @@
 <p>
     No results match your search for <span style="font-weight: bold;">&ldquo;<!-- TMPL_VAR NAME="query" -->&rdquo;</span> in <!-- TMPL_VAR NAME="LibraryName" -->
 </p>
-<a href="JavaScript:back();" title="New search">Perform a new search</a>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="query_error" -->
@@ -78,6 +77,19 @@
 </div>
 <!-- /TMPL_IF -->
 
+<fieldset id="acqui_basket_add">
+        <legend>Add To Order</legend>
+        <form action="/cgi-bin/koha/acqui/neworderbiblio.pl" method="post">
+            <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
+            <input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+            <ul><li><label for="q">From an existing record: </label><input id="q" type="text"  size="25" name="q" />
+            <input type="submit" class="submit" value="Search" /></li>
+            <li><a href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">From a Suggestion</a></li>
+            <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;basketno=<!-- TMPL_VAR NAME="basketno" -->">From a new (empty) record</a></li>
+            </ul>
+        </form>
+    </fieldset>
+
 </div>
 </div>
 <div class="yui-b">
-- 
1.5.5.GIT




More information about the Koha-patches mailing list