[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Labels.pm [rel_2_2]
From: |
Mason James |
Subject: |
[Koha-cvs] koha/C4 Labels.pm [rel_2_2] |
Date: |
Tue, 10 Jul 2007 13:23:24 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: Mason James <sushi> 07/07/10 13:23:24
Modified files:
C4 : Labels.pm
Log message:
little fix for label ordering
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.4&r2=1.3.2.5
Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.5
diff -u -b -r1.3.2.4 -r1.3.2.5
--- Labels.pm 10 Jul 2007 10:59:20 -0000 1.3.2.4
+++ Labels.pm 10 Jul 2007 13:23:24 -0000 1.3.2.5
@@ -188,7 +188,8 @@
}
sub get_text_fields {
- my ($layout_id) = @_;
+ my ($layout_id, $sorttype) = @_;
+
my ( $a, $b, $c, $d, $e, $f, $g, $h, $i );
my $sortorder = get_layout($layout_id);
@@ -196,35 +197,37 @@
# $sortorder
$a = {
- code => 'ITYPE',
+ code => 'itemtype',
desc => "Item Type",
order => $sortorder->{'itemtype'}
};
$b = {
- code => 'DEWEY',
- desc => "Dewey/Callnumber",
+ code => 'dewey',
+ desc => "Dewey",
order => $sortorder->{'dewey'}
};
- $c = { code => 'ISSN', desc => "ISSN", order => $sortorder->{'issn'} };
- $d = { code => 'ISBN', desc => "ISBN", order => $sortorder->{'isbn'} };
+ $c = { code => 'issn', desc => "ISSN",
+ order => $sortorder->{'issn'} };
+ $d = { code => 'isbn', desc => "ISBN",
+ order => $sortorder->{'isbn'} };
$e = {
- code => 'CLASS',
+ code => 'classification',
desc => "Classification",
order => $sortorder->{'class'}
};
$f = {
- code => 'SUBCLASS',
+ code => 'subclass',
desc => "Sub-Class",
order => $sortorder->{'subclass'}
};
$g = {
- code => 'BARCODE',
+ code => 'barcode',
desc => "Barcode",
order => $sortorder->{'barcode'}
};
$h =
- { code => 'AUTHOR', desc => "Author", order => $sortorder->{'author'} };
- $i = { code => 'TITLE', desc => "Title", order => $sortorder->{'title'} };
+ { code => 'author', desc => "Author", order => $sortorder->{'author'} };
+ $i = { code => 'title', desc => "Title", order => $sortorder->{'title'} };
my @text_fields = ( $a, $b, $c, $d, $e, $f, $g, $h, $i );
@@ -237,7 +240,8 @@
my $active_fields;
foreach my $field (@sorted_fields) {
- $active_fields .= "$field->{'code'} ";
+ $sorttype eq 'codes' ? $active_fields .= "$field->{'code'} " :
+ $active_fields .= "$field->{'desc'} ";
}
return $active_fields;
@@ -645,7 +649,14 @@
# add your printable fields manually in here
- my @fields = GetItemFields();
+my $layout_id = $$conf_data->{'id'};
+
+# my @fields = GetItemFields();
+
+my $str_fields = get_text_fields($layout_id, 'codes' );
+my @fields = split(/ /, $str_fields);
+### @fields
+
my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) );
my $hPos = ( $x_pos + $left_text_margin );
@@ -655,6 +666,7 @@
foreach my $field (@fields) {
# testing hack
+# $$item->{"$field"} = $field . ": " . $$item->{"$field"};
# if the display option for this field is selected in the DB,
# and the item record has some values for this field, display it.