title
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 13 Jun 2011 16:54:55 +0000 (18:54 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 13 Jun 2011 16:57:22 +0000 (18:57 +0200)
ferlib2koha.pl

index 66a4734..56bf58a 100755 (executable)
@@ -88,6 +88,8 @@ sub borrowers {
 
                $row->{borrowernotes} = lookup($f, 'clanorg', 'ozn_vrclan||ozn_clan', 'napom_clan', $row->{'cardnumber'}, undef);
 
+               $row->{title} = lookup($f, 'titula', 'ozn_titula', 'opis_titula', $row->{title}, $row->{title});
+
                my $jmbg = delete $row->{jmbg};
 
                insert 'borrowers' => $row;
@@ -140,7 +142,7 @@ select
   'D' || sif_djel as cardnumber,
   ime_djel as firstname,
   prez_djel as surname,
-  ozn_titula as title, -- FIXME 
+  ozn_titula as title,
 --  sif_orgjed (REF orgjed) as B_address,
 --  sif_strsp_djel as ??,
   tel_djel as phonepro,
@@ -163,7 +165,7 @@ select
   'O' || mbr_clan as cardnumber,
   ime_clan as firstname,
   prez_clan as surname,
-  ozn_titula as title, -- ?
+  ozn_titula as title,
   zvanje_clan as ethnicity, -- XXX we are not allowerd by low to collect ethnicity
 --  krat_poduz (REF poduz) as B_address,
   tel_poduz as B_phone,
@@ -178,6 +180,11 @@ select
 from clost
 };
 
+my $sth_syspref = $k->prepare(qq{ update systempreferences set value=? where variable=? });
+my $BorrowersTitles = join('|', @{ $k->selectcol_arrayref(qq{ select distinct title from borrowers where title != '' }) });
+$sth_syspref->execute( $BorrowersTitles => 'BorrowersTitles' );
+warn "# BorrowersTitles [$BorrowersTitles]";
+
 } # import->{borrowers}
 
 sub issues {