[Koha-patches] [PATCH] MT5189 let's the librarian choose the itemtype when ordering

paul.poulain at biblibre.com paul.poulain at biblibre.com
Tue Apr 5 15:16:47 CEST 2011


From: Paul Poulain <paul.poulain at biblibre.com>

For libraries with item-level_itype, the itemtype is in the item.
For others, it's in the biblio and should be added with the title/author when it's ordered

This patch adds the list when applicable,and build the biblio record accordingly
---
 acqui/addorder.pl                                  |    1 +
 acqui/neworderempty.pl                             |    4 ++++
 .../prog/en/modules/acqui/neworderempty.tmpl       |   18 ++++++++++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/acqui/addorder.pl b/acqui/addorder.pl
index 44623ec..e321d2c 100755
--- a/acqui/addorder.pl
+++ b/acqui/addorder.pl
@@ -204,6 +204,7 @@ if ( $orderinfo->{quantity} ne '0' ) {
                 "biblioitems.publishercode"   => $$orderinfo{publishercode}   ? $$orderinfo{publishercode} : "",
                 "biblioitems.publicationyear" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
                 "biblio.copyrightdate"        => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
+                "biblioitems.itemtype"        => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "",
             });
 
         # create the record in catalogue, with framework ''
diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index e6ceccc..5adffad 100755
--- a/acqui/neworderempty.pl
+++ b/acqui/neworderempty.pl
@@ -324,6 +324,9 @@ if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) {
     
     $template->param(items => \@itemloop);
 }
+# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
+my @itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes');
+
 
 # fill template
 $template->param(
@@ -368,6 +371,7 @@ $template->param(
     budget_loop      => $budget_loop,
     isbn             => $data->{'isbn'},
     seriestitle      => $data->{'seriestitle'},
+    itemtypeloop  => \@itemtypes,
     quantity         => $data->{'quantity'},
     quantityrec      => $data->{'quantity'},
     rrp              => $data->{'rrp'},
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
index d8b34ce..57a2f38 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
@@ -247,6 +247,24 @@ $(document).ready(function()
                 <input type="text" size="50" name="series" id="series" value="<!-- TMPL_VAR NAME="seriestitle" -->" />
             <!-- /TMPL_IF -->
         </li>
+        </li>
+            <!-- TMPL_UNLESS name="biblionumber" -->
+            <!-- TMPL_IF name="itemtypeloop" -->
+            <li>
+                <span class="label">Item type:</span>
+                <select name="itemtype" style="width:12em;">
+                <!-- TMPL_LOOP NAME="itemtypeloop" -->
+                    <!-- TMPL_IF Name="selected"-->
+                    <option value="<!-- TMPL_VAR NAME="itemtype" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
+                    <!--TMPL_ELSE --> <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
+                    <!-- /TMPL_IF -->
+                <!-- /TMPL_LOOP -->
+                </select>
+            </li>
+            <!-- /TMPL_IF -->
+            <!-- /TMPL_UNLESS -->
+
+
         </ol>
     </fieldset>
     <!-- TMPL_IF name="items" -->
-- 
1.7.1



More information about the Koha-patches mailing list