[Koha-cvs] koha/C4 Labels.pm [dev_week]

Mason James szrj1m at yahoo.com
Sun Oct 21 02:15:03 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Mason James <sushi>	07/10/21 00:15:03

Modified files:
	C4             : Labels.pm 

Log message:
	addng/saving justify now

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.49&r2=1.3.4.50

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.49
retrieving revision 1.3.4.50
diff -u -b -r1.3.4.49 -r1.3.4.50
--- Labels.pm	20 Oct 2007 14:44:22 -0000	1.3.4.49
+++ Labels.pm	21 Oct 2007 00:15:01 -0000	1.3.4.50
@@ -65,7 +65,8 @@
   &add_batch &SetFontSize &printText
   &GetItemFields
   &get_text_fields &get_batch_count
-  get_layout  &add_layout &get_sorted_text
+  &get_layout  &add_layout &get_sorted_text
+  &get_text_justify
 
   &save_layout
   &set_active_layout &by_order
@@ -217,6 +218,7 @@
 sub build_text_dropbox {
     my ($order) = @_;
 
+
     #  my @fields      = get_text_fields();
     #    my $field_count = scalar @fields;
     my $field_count = 10;    # <-----------       FIXME hard coded
@@ -442,6 +444,28 @@
     return @array;
 }
 
+# get text justify values for layout, 
+#  returns active value too, if passed layout arg
+sub get_text_justify {
+    my ($layout_id) = @_;
+    my $layout      = get_layout($layout_id) if $layout_id;
+### layout
+    my $text_justify    = $layout->{'text_justify'};
+    my @array;
+
+    push( @array, { code  => 'R',      desc => 'Right' } );
+    push( @array, { code => 'L',      desc => 'Left' } );
+
+    foreach my $line (@array) {
+        if ( $line->{'code'} eq $text_justify ) {
+            $line->{'active'} = 1;
+        }
+    }
+    return @array;
+}
+
+
+
 sub GetUnitsValue {
     my ($units) = @_;
     my $unitvalue;
@@ -633,26 +657,32 @@
         $barcodetype, $title,        $subtitle,       $isbn,
         $issn,        $itemtype,     $bcn,            $dcn,
         $classif,     $subclass,     $itemcallnumber, $author,
-        $tmpl_id,     $printingtype, $guidebox,       $startlabel,
-        $callnum_split,         $layoutname
+        $ccode,       $tmpl_id,     $printingtype, $guidebox,  
+        $startlabel,  $callnum_split, $justify,   $layoutname
     ) = @_;
 
+### @_ 
+### $startlabel
+
+
     my $dbh    = C4::Context->dbh;
     my $query2 = "update labels_conf set active = NULL";
     my $sth2   = $dbh->prepare($query2);
     $sth2->execute();
     my $query2 = "INSERT INTO labels_conf
-            ( barcodetype, title, subtitle, isbn,issn, itemtype, barcode,
-              dewey, class, subclass, itemcallnumber, author, printingtype,
-                guidebox, startlabel, callnum_split, layoutname, active )
-               values ( ?, ?, ?, ?, ?, ?, ?, ?, ?,? ,?, ?, ?, ?,?,?,?, 1 )";
+            ( barcodetype, title, subtitle, isbn,
+                issn, itemtype, barcode,   dewey, 
+                class, subclass, itemcallnumber, author, ccode,
+                printingtype,    guidebox, startlabel, 
+                callnum_split, justify,  layoutname, active )
+               values ( ?, ?, ?, ?, ?, ?, ?, ?,  ?, ? ,?, ?,
+                        ?, ?,?,?,?,?, ?, 1 )";
     my $sth2 = $dbh->prepare($query2);
     $sth2->execute(
-        $barcodetype, $title, $subtitle, $isbn, $issn,
-
-        $itemtype, $bcn,            $dcn,    $classif,
-        $subclass, $itemcallnumber, $author, $printingtype,
-        $guidebox, $startlabel,  $callnum_split,   $layoutname
+            $barcodetype, $title, $subtitle, $isbn,
+            $issn,        $itemtype, $bcn,   $dcn, 
+            $classif,     $subclass, $itemcallnumber, $author, $ccode,
+            $printingtype,  $guidebox, $startlabel,    $callnum_split,               $justify, $layoutname
     );
     $sth2->finish;
 
@@ -666,7 +696,7 @@
         $issn,        $itemtype,   $bcn,            $dcn,
         $classif,     $subclass,   $itemcallnumber, $author,
         $ccode,       $tmpl_id,    $printingtype,   $guidebox,
-        $startlabel,  $callnum_split, $layoutname, $layout_id
+        $startlabel,  $callnum_split, $justify , $layoutname, $layout_id
     ) = @_;
 
 ### @_;
@@ -675,17 +705,19 @@
 
     my $dbh    = C4::Context->dbh;
     my $query2 = "update labels_conf set 
-             barcodetype=?, title=?, subtitle=?, isbn=?,issn=?, 
-            itemtype=?, barcode=?,    dewey=?, class=?,
-             subclass=?, itemcallnumber=?, author=?, ccode=?,  printingtype=?,  
-               guidebox=?, startlabel=?, callnum_split=?,  layoutname=? where id = ?";
+             barcodetype=?, title=?, subtitle=?, isbn=?,
+            issn=?,    itemtype=?, barcode=?,    dewey=?,
+             class=?, subclass=?, itemcallnumber=?, author=?,
+             ccode=?, printingtype=?,  guidebox=?, startlabel=?,
+             callnum_split=?, text_justify=?,  layoutname=? where id = ?";
+
     my $sth2 = $dbh->prepare($query2);
     $sth2->execute(
         $barcodetype, $title,        $subtitle,       $isbn,
         $issn,        $itemtype,     $bcn,            $dcn,
         $classif,     $subclass,     $itemcallnumber, $author,
         $ccode,       $printingtype, $guidebox,       $startlabel,
-$callnum_split,         $layoutname,  $layout_id
+$callnum_split,  $justify,   $layoutname,  $layout_id
     );
     $sth2->finish;
 





More information about the Koha-cvs mailing list