|
Lines 78-84
sub _get_label_item {
Link Here
|
| 78 |
# FIXME This makes for a very bulky data structure; data from tables w/duplicate col names also gets overwritten. |
78 |
# FIXME This makes for a very bulky data structure; data from tables w/duplicate col names also gets overwritten. |
| 79 |
# Something like this, perhaps, but this also causes problems because we need more fields sometimes. |
79 |
# Something like this, perhaps, but this also causes problems because we need more fields sometimes. |
| 80 |
# SELECT i.barcode, i.itemcallnumber, i.itype, bi.isbn, bi.issn, b.title, b.author |
80 |
# SELECT i.barcode, i.itemcallnumber, i.itype, bi.isbn, bi.issn, b.title, b.author |
| 81 |
my $sth = $dbh->prepare("SELECT bi.*, i.*, b.* FROM items AS i, biblioitems AS bi ,biblio AS b WHERE itemnumber=? AND i.biblioitemnumber=bi.biblioitemnumber AND bi.biblionumber=b.biblionumber;"); |
81 |
my $sth = $dbh->prepare("SELECT bi.*, i.*, b.*,br.* FROM items AS i, biblioitems AS bi ,biblio AS b, branches AS br WHERE itemnumber=? AND i.biblioitemnumber=bi.biblioitemnumber AND bi.biblionumber=b.biblionumber AND i.homebranch=br.branchcode;"); |
| 82 |
$sth->execute($item_number); |
82 |
$sth->execute($item_number); |
| 83 |
if ($sth->err) { |
83 |
if ($sth->err) { |
| 84 |
warn sprintf('Database returned the following error: %s', $sth->errstr); |
84 |
warn sprintf('Database returned the following error: %s', $sth->errstr); |
|
Lines 185-191
sub _get_barcode_data {
Link Here
|
| 185 |
( |
185 |
( |
| 186 |
@{ $kohatables->{'biblio'} }, |
186 |
@{ $kohatables->{'biblio'} }, |
| 187 |
@{ $kohatables->{'biblioitems'} }, |
187 |
@{ $kohatables->{'biblioitems'} }, |
| 188 |
@{ $kohatables->{'items'} } |
188 |
@{ $kohatables->{'items'} }, |
|
|
189 |
@{ $kohatables->{'branches'} } |
| 189 |
) |
190 |
) |
| 190 |
); |
191 |
); |
| 191 |
FIELD_LIST: |
192 |
FIELD_LIST: |
|
Lines 249-255
sub _get_barcode_data {
Link Here
|
| 249 |
sub _desc_koha_tables { |
250 |
sub _desc_koha_tables { |
| 250 |
my $dbh = C4::Context->dbh(); |
251 |
my $dbh = C4::Context->dbh(); |
| 251 |
my $kohatables; |
252 |
my $kohatables; |
| 252 |
for my $table ( 'biblio','biblioitems','items' ) { |
253 |
for my $table ( 'biblio','biblioitems','items','branches' ) { |
| 253 |
my $sth = $dbh->column_info(undef,undef,$table,'%'); |
254 |
my $sth = $dbh->column_info(undef,undef,$table,'%'); |
| 254 |
while (my $info = $sth->fetchrow_hashref()){ |
255 |
while (my $info = $sth->fetchrow_hashref()){ |
| 255 |
push @{$kohatables->{$table}} , $info->{'COLUMN_NAME'} ; |
256 |
push @{$kohatables->{$table}} , $info->{'COLUMN_NAME'} ; |