[Koha-devel] Sorting alphabetically the subfields in additem

Michael Hafen mdhafen at tech.washk12.org
Wed Aug 18 19:56:46 CEST 2010


I ran into this too, my librarians wanted the item fields in a certain
order though.  So I made a hash of the subfield codes and a sort weight.
That did the job for me.

On Wed, 2010-08-18 at 18:17 +0200, Salvador Zaragoza Rubio wrote:
> Hi,
> 
> Sometimes when you mess around with the marc structure of the bibliographic
> frameworks, the subfields of the 952 field are showed in a random manner
> in the cataloguing section.
> 
> A possible improvement to display the subfields sorted when you
> add or edit an item in the intranet at the page
> /cgi-bin/koha/cataloguing/additem.pl .
> 
> Just before passing the reference of the array loop_data as a param
> to the template, add the line of code:
> 
> @loop_data = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [ $_, $_->{subfield} ] } @loop_data;
> 
> to sort alphabetically de code of the subfields and show them clearly.
> 
> 
> Salva
> 
> 
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel

-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://development.washk12.org/gitweb/
or
git://development.washk12.org/koha




More information about the Koha-devel mailing list