BZ6066 let's the librarian choose the itemtype when ordering
authorPaul Poulain <paul.poulain@biblibre.com>
Wed, 29 Jun 2011 18:43:50 +0000 (20:43 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Sun, 10 Jul 2011 08:28:37 +0000 (20:28 +1200)
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
(BibLibre MT5189)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
acqui/addorder.pl
acqui/neworderempty.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt

index 44623ec..e321d2c 100755 (executable)
@@ -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 ''
index bd06b0c..db3e852 100755 (executable)
@@ -329,6 +329,8 @@ 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(
@@ -373,6 +375,7 @@ $template->param(
     budget_loop      => $budget_loop,
     isbn             => $data->{'isbn'},
     seriestitle      => $data->{'seriestitle'},
+    itemtypeloop     => \@itemtypes,
     quantity         => $data->{'quantity'},
     quantityrec      => $data->{'quantity'},
     rrp              => $data->{'rrp'},
index d6c8459..dd15658 100644 (file)
@@ -249,6 +249,23 @@ $(document).ready(function()
                 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
             [% END %]
         </li>
+        </li>
+            [% UNLESS ( biblionumber ) %]
+            [% IF ( itemtypeloop ) %]
+            <li>
+                <span class="label">Item type:</span>
+                <select name="itemtype" style="width:12em;">
+                [% FOREACH itemtype IN itemtypeloop %]
+                    [% IF ( itemtype.selected ) %]
+                        <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
+                    [% ELSE %]
+                        <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
+                    [% END %]
+                [% END %]
+                </select>
+            </li>
+            [% END %]
+            [% END %]
         </ol>
     </fieldset>
     [% IF ( items ) %]