[Koha] Br Raphael

Jonathan Druart jonathan.druart at bugs.koha-community.org
Tue Feb 16 03:03:54 NZDT 2021


Hello,
Are you familiar with perl?
You can create a simple script to generate 1 item per biblio:

"""
use Modern::Perl;
use Koha::Biblios;
use Koha::Items;

my $biblios = Koha::Biblios->search;
my $branchcode = 'CPL';
while ( my $biblio = $biblios->next ) {
    Koha::Item->new(
        {
            biblionumber  => $biblio->biblionumber,
            homebranch    => $branchcode,
            holdingbranch => $branchcode,
            barcode       => "barcode_" . $biblio->biblionumber,
            itype            => $biblio->biblioitem->itemtype,
        }
    )->store;
}
"""

Replace your branchcode in the script and run it.
It will create 1 item per bibliographic record with a barcode
"barcode_" suffixed by the biblionumber.
Please run it in a test environment and confirm it works as you expect
before running it on your production server :)

Regards,
Jonathan

Le lun. 15 févr. 2021 à 14:46, <library at princeofpeaceabbey.org> a écrit :
>
> Ian,
>
> The answer to you questions is true. I just need to have the right
> syntax for mysql to add books to the items. I have the means of making
> the whole collection get barcodes within a few minutes. The only
> problem is that the barcode thing only does those items that are
> connected to a record.
>
> I just need to make all the items connect to a record.
>
> Br Raphael
>
>
> Quoting Ian Bays <ian.bays at ptfs-europe.com>:
>
> > Hello
> >
> > Am I right in guessing that the majority of the books (titles) only
> > have a single copy?  Also am I right in thinking most of the actual
> > books (items) have no computer-readable numbers such as barcodes?
> >
> > If both the above are true and if you have access to the
> > command-line to run some SQL, then we could come up with a simple
> > SQL command to add a single item for each title.  These items would
> > have no barcodes to identify them.  They would have to have a branch
> > and an item type (and usually a location but that is optional).
> >
> > If many titles have multiple items or the items do have identifying
> > numbers then is this information held in a spreadsheet somewhere?
> > If so there may be better ways to get the items created.
> >
> > Can I ask why you want to add the items?  Is it so that the books
> > can be issued to borrowers?  If so I think they may need an
> > identifying number.
> >
> > Can you say what version of Koha you have as that might determine
> > what tools are available for some of the other options.
> >
> > One is never too old to learn!  I'm sure you will get help from the
> > community.
> >
> > Best regards.
> > Ian
> >
> > On 14/02/2021 14:07, library at princeofpeaceabbey.org wrote:
> >>
> >> I am Br Raphael of Prince of Peace Abbey. I have been learning Koha
> >> for the past year. I have become the librarian of the Abbey along
> >> with a few other jobs. The library has about 40K volumes. I also
> >> have four other libraries to merge into the main.
> >>
> >> I have to thank all who have helped in the past. Now my biggest
> >> problem is that the librarian before me, God rest his soul, did not
> >> attach Items to those 40K books. Beside doing it the hard way. That
> >> is one by one. I hope there is a faster way to do that. I am not a
> >> programmer so I need step by step instructions. I think I am doing
> >> good with me being 74 years of age. I might be the oldest librarian
> >> using Koha.
> >>
> >>
> >>
> >> _______________________________________________
> >>
> >> Koha mailing list  http://koha-community.org
> >> Koha at lists.katipo.co.nz
> >> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
> >>
> >>
> >
> > --
> > Ian Bays
> > Director, PTFS Europe Limited
> > Content Management and Library Solutions
> >
> > _______________________________________________
> >
> > Koha mailing list  http://koha-community.org
> > Koha at lists.katipo.co.nz
> > Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>
>
>
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list