koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/barcodes label-item-search.pl [dev_week]


From: Mason James
Subject: [Koha-cvs] koha/barcodes label-item-search.pl [dev_week]
Date: Thu, 05 Jul 2007 01:06:17 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Mason James <sushi>     07/07/05 01:06:17

Modified files:
        barcodes       : label-item-search.pl 

Log message:
        working rel2.2 itemtype dropbox

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-item-search.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.4&r2=1.1.2.1.2.5

Patches:
Index: label-item-search.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/label-item-search.pl,v
retrieving revision 1.1.2.1.2.4
retrieving revision 1.1.2.1.2.5
diff -u -b -r1.1.2.1.2.4 -r1.1.2.1.2.5
--- label-item-search.pl        6 Oct 2006 01:58:47 -0000       1.1.2.1.2.4
+++ label-item-search.pl        5 Jul 2007 01:06:17 -0000       1.1.2.1.2.5
@@ -18,7 +18,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-use strict;
+#use strict;
 require Exporter;
 use CGI;
 use C4::Koha;
@@ -34,6 +34,9 @@
 use C4::SearchMarc;
 use C4::Koha;    # XXX subfield_is_koha_internal_p
 
+use Smart::Comments;
+use Data::Dumper;
+
 # Creates a scrolling list with the associated default value.
 # Using more than one scrolling list in a CGI assigns the same default value 
to all the
 # scrolling lists on the page !?!? That's why this function was written.
@@ -41,6 +44,11 @@
 my $query = new CGI;
 my $type  = $query->param('type');
 my $op    = $query->param('op');
+my $batch_id        = $query->param('batch_id');
+my $dateaccessioned = $query->param('dateaccessioned');
+
+### $query;
+
 my $dbh   = C4::Context->dbh;
 
 my $startfrom = $query->param('startfrom');
@@ -175,8 +183,16 @@
         from           => $from,
         to             => $to,
         numbers        => address@hidden,
+        batch_id       => $batch_id,
     );
 }
+
+#
+#
+#   search section
+#
+#
+
 else {
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
@@ -188,38 +204,36 @@
             debug           => 1,
         }
     );
-    my $sth =
-      $dbh->prepare(
-        "Select itemtype,description from itemtypes order by description");
-    $sth->execute;
-    my @itemtype;
-    my %itemtypes;
-    push @itemtype, "";
-    $itemtypes{''} = "";
-    while ( my ( $value, $lib ) = $sth->fetchrow_array ) {
-        push @itemtype, $value;
-        $itemtypes{$value} = $lib;
-    }
-
-    my $CGIitemtype = CGI::scrolling_list(
-        -name     => 'value',
-        -values   => address@hidden,
-        -labels   => \%itemtypes,
-        -size     => 1,
-        -multiple => 0
+
+
+   #using old rel2.2 getitemtypes for testing!!!!, not devweek's GetItemTypes()
+
+    my $itemtypes = getitemtypes;
+    my @itemtypeloop;
+    foreach my $thisitemtype (keys %$itemtypes) {
+           my $selected = 1 if $thisbranch eq $branch;
+            my %row =(value => $thisitemtype,
+                                   selected => $selected,
+                                    description => 
$itemtypes->{$thisitemtype}->{'description'},
     );
-    $sth->finish;
+            push @itemtypeloop, \%row;
+    }  
 
-    $template->param( CGIitemtype => $CGIitemtype, );
-}
 
-# Print the page
-$template->param(
+
+    $template->param(
+    itemtypeloop =>address@hidden,
+        batch_id     => $batch_id,
+    );
+
+    # Print the page
+    $template->param(
     intranetcolorstylesheet =>
       C4::Context->preference("intranetcolorstylesheet"),
     intranetstylesheet => C4::Context->preference("intranetstylesheet"),
     IntranetNav        => C4::Context->preference("IntranetNav"),
-);
+    );
+}
 output_html_with_http_headers $query, $cookie, $template->output;
 
 # Local Variables:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]