adding a "location" field to the library.

This field is useful when the callnumber contains no information on the room where the item is stored.
With this field, we now have 3 levels of informations to find a book :
* the branch.
* the location.
* the callnumber.

This should be versatile enough to solve any storing method.
This hack is quite simple, due to the nice Biblio.pm API. The MARC => koha db link is automatically managed. Just add the link in the parameters section.
This commit is contained in:
tipaul 2004-09-06 10:00:19 +00:00
parent f3e5fcd15d
commit 8d868bb448
4 changed files with 53 additions and 27 deletions

View file

@ -1742,7 +1742,8 @@ sub OLDnewitems {
homebranch = ?, holdingbranch = ?, homebranch = ?, holdingbranch = ?,
price = ?, replacementprice = ?, price = ?, replacementprice = ?,
replacementpricedate = NOW(), itemnotes = ?, replacementpricedate = NOW(), itemnotes = ?,
itemcallnumber =?, notforloan = ? itemcallnumber =?, notforloan = ?,
location = ?
" "
); );
$sth->execute( $sth->execute(
@ -1752,7 +1753,7 @@ sub OLDnewitems {
$item->{'homebranch'}, $item->{'holdingbranch'}, $item->{'homebranch'}, $item->{'holdingbranch'},
$item->{'price'}, $item->{'replacementprice'}, $item->{'price'}, $item->{'replacementprice'},
$item->{'itemnotes'}, $item->{'itemcallnumber'}, $item->{'itemnotes'}, $item->{'itemcallnumber'},
$item->{'notforloan'} $item->{'notforloan'}, $item->{'location'}
); );
} }
else { else {
@ -1763,7 +1764,8 @@ sub OLDnewitems {
homebranch = ?, holdingbranch = ?, homebranch = ?, holdingbranch = ?,
price = ?, replacementprice = ?, price = ?, replacementprice = ?,
replacementpricedate = NOW(), itemnotes = ?, replacementpricedate = NOW(), itemnotes = ?,
itemcallnumber = ? , notforloan = ? itemcallnumber = ? , notforloan = ?,
location = ?
" "
); );
$sth->execute( $sth->execute(
@ -1772,7 +1774,8 @@ sub OLDnewitems {
$item->{'booksellerid'}, $item->{'homebranch'}, $item->{'booksellerid'}, $item->{'homebranch'},
$item->{'holdingbranch'}, $item->{'price'}, $item->{'holdingbranch'}, $item->{'price'},
$item->{'replacementprice'}, $item->{'itemnotes'}, $item->{'replacementprice'}, $item->{'itemnotes'},
$item->{'itemcallnumber'}, $item->{'notforloan'} $item->{'itemcallnumber'}, $item->{'notforloan'},
$item->{'location'}
); );
} }
if ( defined $sth->errstr ) { if ( defined $sth->errstr ) {
@ -1788,8 +1791,7 @@ sub OLDmoditem {
# my ($dbh,$loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)=@_; # my ($dbh,$loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)=@_;
# my $dbh=C4Connect; # my $dbh=C4Connect;
$item->{'itemnum'} = $item->{'itemnumber'} unless $item->{'itemnum'}; $item->{'itemnum'} = $item->{'itemnumber'} unless $item->{'itemnum'};
my $query = my $query = "update items set barcode=?,itemnotes=?,itemcallnumber=?,notforloan=? where itemnumber=?";
"update items set barcode=?,itemnotes=?,itemcallnumber=?,notforloan=? where itemnumber=?";
my @bind = ( my @bind = (
$item->{'barcode'}, $item->{'notes'}, $item->{'barcode'}, $item->{'notes'},
$item->{'itemcallnumber'}, $item->{'notforloan'}, $item->{'itemcallnumber'}, $item->{'notforloan'},
@ -1808,13 +1810,14 @@ sub OLDmoditem {
itemlost=?, itemlost=?,
wthdrawn=?, wthdrawn=?,
itemcallnumber=?, itemcallnumber=?,
notforloan=?"; notforloan=?,
location=?";
@bind = ( @bind = (
$item->{'bibitemnum'}, $item->{'barcode'}, $item->{'bibitemnum'}, $item->{'barcode'},
$item->{'notes'}, $item->{'homebranch'}, $item->{'notes'}, $item->{'homebranch'},
$item->{'lost'}, $item->{'wthdrawn'}, $item->{'lost'}, $item->{'wthdrawn'},
$item->{'itemcallnumber'}, $item->{'notforloan'}, $item->{'itemcallnumber'}, $item->{'notforloan'},
$item->{'itemnum'} $item->{'location'}, $item->{'itemnum'}
); );
if ($item->{homebranch}) { if ($item->{homebranch}) {
$query.=",homebranch=?"; $query.=",homebranch=?";
@ -2533,6 +2536,17 @@ Paul POULAIN paul.poulain@free.fr
# $Id$ # $Id$
# $Log$ # $Log$
# Revision 1.102 2004/09/06 10:00:19 tipaul
# adding a "location" field to the library.
# This field is useful when the callnumber contains no information on the room where the item is stored.
# With this field, we now have 3 levels of informations to find a book :
# * the branch.
# * the location.
# * the callnumber.
#
# This should be versatile enough to solve any storing method.
# This hack is quite simple, due to the nice Biblio.pm API. The MARC => koha db link is automatically managed. Just add the link in the parameters section.
#
# Revision 1.101 2004/08/18 16:01:37 tipaul # Revision 1.101 2004/08/18 16:01:37 tipaul
# modifs to support frameworkcodes # modifs to support frameworkcodes
# #

View file

@ -106,7 +106,7 @@
</tr> </tr>
<!-- TMPL_LOOP NAME="ITEM_RESULTS" --> <!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<tr> <tr>
<td><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_IF name="itemcallnumber" -->(<!-- TMPL_VAR NAME="itemcallnumber" -->)<!-- /TMPL_IF --></td> <td><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_VAR NAME="location" --> <!-- TMPL_IF name="itemcallnumber" -->(<!-- TMPL_VAR NAME="itemcallnumber" -->)<!-- /TMPL_IF --></td>
<td><!-- TMPL_VAR NAME="datedue" --></td> <td><!-- TMPL_VAR NAME="datedue" --></td>
<td><!-- TMPL_VAR NAME="datelastseen" --></td> <td><!-- TMPL_VAR NAME="datelastseen" --></td>
<td><!-- TMPL_VAR NAME="barcode" --></td> <td><!-- TMPL_VAR NAME="barcode" --></td>

View file

@ -65,7 +65,7 @@
</td> </td>
<td <!-- TMPL_IF name="even" -->class="hilighted"<!-- /TMPL_IF -->> <td <!-- TMPL_IF name="even" -->class="hilighted"<!-- /TMPL_IF -->>
<!-- TMPL_LOOP name="CN" --> <!-- TMPL_LOOP name="CN" -->
<!-- TMPL_VAR name="holdingbranch" --> <!-- TMPL_IF name="itemcallnumber" -->(<!-- TMPL_VAR name="itemcallnumber" -->)<!-- /TMPL_IF --> <!-- TMPL_VAR name="holdingbranch" --> <!-- TMPL_VAR name="location" --> <!-- TMPL_IF name="itemcallnumber" -->(<!-- TMPL_VAR name="itemcallnumber" -->)<!-- /TMPL_IF -->
<!-- /TMPL_LOOP --> <!-- /TMPL_LOOP -->
</td> </td>
<td <!-- TMPL_IF name="even" -->class="hilighted"<!-- /TMPL_IF -->> <td <!-- TMPL_IF name="even" -->class="hilighted"<!-- /TMPL_IF -->>

View file

@ -289,20 +289,20 @@ my %requiretables = (
suggestionid int(8) NOT NULL auto_increment, suggestionid int(8) NOT NULL auto_increment,
suggestedby int(11) NOT NULL default '0', suggestedby int(11) NOT NULL default '0',
managedby int(11) default NULL , managedby int(11) default NULL ,
status varchar(10) NOT NULL default '', STATUS varchar(10) NOT NULL default '',
note text, note text,
author varchar(80) default NULL , author varchar(80) default NULL ,
title varchar(80) default NULL , title varchar(80) default NULL ,
copyrightdate smallint(6) default NULL , copyrightdate smallint(6) default NULL ,
publishercode varchar(255) default NULL , publishercode varchar(255) default NULL ,
date timestamp(8) NOT NULL , date timestamp(8) NOT NULL ,
volumedesc char(255) default NULL, volumedesc varchar(255) default NULL ,
publicationyear smallint(6) default NULL, publicationyear smallint(6) default '0',
place char(255) default NULL, place varchar(255) default NULL ,
isbn char(10) default NULL, isbn varchar(10) default NULL ,
mailoverseeing smallint(1) default 0, mailoverseeing smallint(1) default '0',
biblionumber int(11) default NULL , biblionumber int(11) default NULL ,
PRIMARY KEY (suggestionnumber), PRIMARY KEY (suggestionid) ,
KEY suggestedby(suggestedby) , KEY suggestedby(suggestedby) ,
KEY managedby(managedby) KEY managedby(managedby)
)", )",
@ -404,7 +404,7 @@ my %requirefields = (
'sort1' => 'char(80)', 'sort1' => 'char(80)',
'sort2' => 'char(80)', }, 'sort2' => 'char(80)', },
aqbudget => {'aqbudgetid' => 'tinyint(4) auto_increment primary key'}, aqbudget => {'aqbudgetid' => 'tinyint(4) auto_increment primary key'},
items => {'paidfor' => 'text'}, items => {'paidfor' => 'text', 'location' => 'char(80)'},
#added so that reference items are not available for reserves... #added so that reference items are not available for reserves...
itemtypes => { 'notforloan' => 'smallint(6)' }, itemtypes => { 'notforloan' => 'smallint(6)' },
@ -418,6 +418,7 @@ my %requirefields = (
'frameworkcode' => 'char(4) not NULL default \'\'', 'frameworkcode' => 'char(4) not NULL default \'\'',
'hidden' => 'tinyint(1)', 'hidden' => 'tinyint(1)',
'isurl' => 'tinyint(1)', 'isurl' => 'tinyint(1)',
'link' => 'char(80)',
}, },
bookshelf => {'owner' => 'char(80)', bookshelf => {'owner' => 'char(80)',
'category' => 'char(1)', 'category' => 'char(1)',
@ -1368,6 +1369,17 @@ $sth->finish;
exit; exit;
# $Log$ # $Log$
# Revision 1.94 2004/09/06 10:00:29 tipaul
# adding a "location" field to the library.
# This field is useful when the callnumber contains no information on the room where the item is stored.
# With this field, we now have 3 levels of informations to find a book :
# * the branch.
# * the location.
# * the callnumber.
#
# This should be versatile enough to solve any storing method.
# This hack is quite simple, due to the nice Biblio.pm API. The MARC => koha db link is automatically managed. Just add the link in the parameters section.
#
# Revision 1.93 2004/08/12 14:50:50 tipaul # Revision 1.93 2004/08/12 14:50:50 tipaul
# bugfixes # bugfixes
# #