[Koha-devel] Head code cleaning (continuing)

Paul POULAIN paul.poulain at free.fr
Thu Sep 22 02:07:24 CEST 2005


Hi,

The TGV travels 300km per hour, except when there is a problem on the 
high speed line. In this case, he travels at 100km per hour and needs 6 
hours to do Paris => Marseille (with >400km on 850 at full speed).
Fortunatly, there is power available for laptops computers, so I could 
work on Koha HEAD, to do some cleaning.
I tried to test as many things as possible, but for sure i've introduced 
new Internal Server Errors or bugs !!!

I mainly worked on C4::Search.pm that contained various subs, most of 
them being not at the right place. So I moved to a better location, 
modified scripts using the moved sub, and also removed some subs that 
where useless.
Now, the Search.pm contains only search related subs. As the Search API 
will be deeply modified for 3.0/Zebra, the Search.pm will probably 
disappear soon, or be 100% rewritten !!

I also :
* continued to modify code & template to use biblionumber instead of : 
bib, bn or biblio...
* continued to normalize API : sub to read things should be called 
getXXX. (subs to add should be newXXX, subs to modify modXXX, and subs 
to delete delXXX)

Here are moved/modified subs from Search.pm:
itemnodata => become getbibliofromitemnumber, moved to Biblio.pm
getborrowercategory => moved to Koha.pm
getbranchname => moved to Koha.pm
isbnsearch => removed, unused

getwebbiblioitems => moved to Biblio.pm
getwebsites => moved to Biblio.pm
QUESTION about websites : is this code used by someone ? not by me and 
not by anyone with MARC=ON probably, as there are no way to reach 
websites pages.

barcodes => moved to Biblio.pm
bibitems => moved to Biblio.pm
ItemType => removed (replaced by a Koha.pm getitemtypeinfo)
itemcount2 => removed, unused

getborracctrecord => moved to Members.pm
borrdata2 => moved to Members.pm
allissues => moved to Members.pm
borrissues => moved to Members.pm
borrdata => moved to Members.pm
BornameSearch => moved to Members.pm

catalogueserach, KeywordSearch, CatSearch, subsearch => nothing changed. 
But should disappear in Koha 3.0, with new zebra search API.

itemdata => moved to Biblio.pm. Renamed get_item_from_barcode
bibdata => moved to Biblio.pm. Should be merged with getbiblio ?
bibitemdata => moved to Biblio.pm. should be merged with bibitems ?
subject => moved to Biblio.pm and renamed as getsubject (used only once 
in modbib.pl)
addauthor => moved to Biblio.pm and renamed getaddauthor (used only once 
in modbib.pl)
subtitle => moved to Biblio.pm and renamed getsubtitle (used only once 
in modbib.pl)

itemissues => moved to Biblio.pm (could have been in Circ.pm as well as 
in Biblio.pm, but it's used in biblio detail, so when we have to read 
other biblio info)

SUGGESTION :
We have many subs to read the catalogue. Imho, we have too many. So we 
could probably clean the code a little bit more.
Another idea would be to split catalogue add/modify/delete and catalogue 
read in 2 subs, as we usually don't need to read and write the catalogue 
in the same script. Would be more clear and could fasten a little the 
code compiling in cgi mode (no effect with mod-perl)

TODO :
Scripts related to members that are in KOHAROOT should be moved to 
another directory (pay, maninvoice...). Probably something like 
/members/ or a new /accounting/

-- 
Paul POULAIN
Consultant indépendant en logiciels libres
responsable francophone de koha (SIGB libre http://www.koha-fr.org)




More information about the Koha-devel mailing list