--- /dev/null
+### LEADER
+
+## LDR 05 - n - new
+marc_leader('05','n');
+
+## LDR 06 - a - language material
+marc_leader('06','a');
+
+## LDR 07 - Bibliographic level
+marc_leader('07','s');
+
+## LDR 17 - Encoding level ; 7 - minimal level, u - unknown
+marc_leader('17','u');
+
+## LDR 18 - i - isbd
+marc_leader('18','i');
+
+## LDR 19 - Multipart resource record level ; # - Not specified or not applicable, a - Set, b - Part with independent title, c - Part with dependent title
+#marc_leader('19','a');
+
+### 005
+marc_fixed('005','00', rec('B'));
+
+### 008 - All materials
+
+if ( rec('A') =~ m/20(\d{6})/ ) {
+ marc_fixed('008','00', $1); # 00-05 - Date entered on file
+}
+
+## za 008 06 treba i lookup u tablicu gdje postoji podatak o tome jel tekuci casopis ili nije?
+## c - Continuing resource currently published
+## d - Continuing resource ceased publication
+
+marc_fixed('008','06','c');
+
+marc_fixed('008','15', # 15-17 - Place of publication, production, or execution
+ lc ( rec('Z') )
+);
+
+marc_fixed('008','35',
+ rec('Y') # 35-37 - Language
+);
+ # 38 - Modified record
+ # 39 - Cataloging source
+
+### 008 - Continuing resources
+marc_fixed('008','18', rec('N') ); # 18 - Frequency
+marc_fixed('008','19', rec('O') ); # 19 - Regularity
+ # 20 - Undefined, ontains a blank (#) or fill character (|)
+
+# 008 21
+marc_fixed('008','21', 'p'); # 21 - Type of continuing resource
+
+ # 22 - Form of original item - blank
+ # 23 - Form of item
+ # 24 - Nature of entire work
+ # 25-27 - Nature of contents
+ # 28 - Government publication
+ # 29 - Conference publication
+ # 30-32 - Undefined
+ # 33 - Original alphabet or script of title
+ # 34 - Entry convention
+
+### 022
+marc('022','a',
+ rec('P')
+);
+
+marc('030','a',
+ rec('U')
+);
+
+### 035$6
+# privemeno koristimo 0356 umjesto 0359, zato ¹to marclint 9 prijavljuje kao gre¹ku
+
+marc('035','a',
+ join_with('',
+ '(HR-ZaDZI)P',
+ rec('C')
+ )
+);
+
+### 040
+# za sve je isti
+
+marc('040','a',
+ 'HR-ZaDZI'
+);
+
+marc('040','b',
+ 'hrv'
+);
+
+marc('040','e',
+ 'HR PPIAK'
+);
+
+### 041 - indikatori
+
+#marc_indicators('041', 0, ' ');
+
+### 041
+
+#marc_repeatable_subfield('041','a',
+# rec('Y')
+#);
+
+
+#_debug(3);
+
+### 044 - zemlja izdavanja
+
+#marc('044','a',
+# rec('Z')
+#);
+
+### 080
+
+marc('080','a',
+ rec('V')
+);
+
+### 210 indikatori
+# marc_indicators('210', '1',' ');
+
+### 210 - ABBREVIATED TITLE
+marc_indicators('210','1',' ');
+marc('210','a',
+ rec('T')
+);
+
+
+
+### 222 indikatori
+# drugi indikator prema èlanu
+# potrebna naknadna kontrola
+
+marc_indicators('222',' ','0');
+
+### 222 - Key title
+
+marc('222','a',
+ rec('Q')
+);
+
+### 245 indikatori
+# generiraju se prema èlanu, trebalo bi mo¾da i prema jeziku (jezika nema uvijek).
+# potrebna naknadna kontrola
+
+marc_indicators('245', 0, 0);
+
+if ( ( rec('E') =~ m/^Die /) ||
+ ( rec('E') =~ m/^Das /) ||
+ ( rec('E') =~ m/^Der /) ||
+ ( rec('E') =~ m/^Les /) ||
+ ( rec('E') =~ m/^The /) ) {
+ marc_indicators('245', 0, 4);
+
+}
+
+if ( ( rec('E') =~ m/^Un /) ||
+ ( rec('E') =~ m/^An /) ||
+ ( rec('E') =~ m/^La /) ||
+ ( rec('E') =~ m/^Le /) ||
+ ( rec('E') =~ m/^Il /) ) {
+ marc_indicators('245', 0, 3);
+}
+
+if ( ( rec('E') =~ m/^A /) ||
+ ( rec('E') =~ m/^L'/) ) {
+ marc_indicators('245', 0, 2);
+}
+
+### 245
+
+my $naslov = '' ;
+my $podnaslov = '' ;
+my $odgovornost = '' ;
+
+if ( rec('E') =~ m/\$a(.*)\$e(.*)\$f(.*)/ ) {
+ $naslov = $1;
+ $podnaslov = $2;
+ $odgovornost = $3;
+} elsif ( rec('E') =~ m/\$a(.*)\$e(.*)/ ) {
+ $naslov = $1;
+ $podnaslov = $2;
+} elsif ( rec('E') =~ m/\$a(.*)\$f(.*)/ ) {
+ $naslov = $1;
+ $odgovornost = $2;
+} elsif ( rec('E') =~ m/\$a(.*)/ ) {
+ $naslov = $1;
+}
+marc('245','a', $naslov);
+marc('245','b', $podnaslov);
+marc('245','c', $odgovornost);
+
+
+### 246 inikatori
+
+### 246
+
+#_debug(0);
+
+
+## 260 - izdavanje
+
+my $mjesto = '' ;
+my $izdavac = '' ;
+
+if ( rec('H') =~ m/\$a(.*)\$c(.*)/ ) {
+ $mjesto = $1 . ' :';
+ $izdavac = $2 . ', ';
+}
+marc('260','a', $mjesto);
+marc('260','b', $izdavac);
+marc('260','c',
+ rec('G')
+);
+
+## 300
+marc('300','a', ' sv. :');
+marc('300','c',
+ rec('K')
+);
+
+## 310
+
+marc('310','a',
+ rec('L')
+);
+
+marc('500','a',
+ rec('AA')
+);
+
+marc_indicators('780',' ','0');
+marc('780','t',
+ rec('R')
+);
+
+marc_indicators('785',' ','0');
+marc('785','t',
+ rec('S')
+);
+
+marc('942','c','C');
+
+marc('952','a',
+ lookup(
+ sub { rec('K') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','b',
+ lookup(
+ sub { rec('K') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','d',
+ lookup(
+ sub { rec('I') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','h',
+ lookup(
+ sub { join_with('',
+ join_with(':',
+ rec('E'),
+ rec('F'),
+ ),
+ rec('D')
+
+ ) },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','r',
+ lookup(
+ sub { rec('M') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','t',
+ lookup(
+ sub { rec('H') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
+
+marc('952','y',
+ lookup(
+ sub { rec('P') },
+ 'dziv','inventar',
+ sub { rec('A') },
+ sub { rec('C') }
+ )
+);
--- /dev/null
+# Ova datoteka sadrzi pravila za generiranje MARC21 ISO 2709 izlazne
+# datoteke. Ulazni format je CDS/ISIS izvorni format, sa zapisima u
+# UNIMARC formatu, koji sadr¿i visestruka odstupanja od standarda.
+
+## konvertira se ako postoji polje 200^a
+if ( rec('200','a') ) {
+
+### LEADER
+
+## LDR 05 - n - new
+marc_leader('05','n');
+
+## LDR 06 - a - language material
+marc_leader('06','a');
+
+## LDR 07 - m - Monograph/item
+marc_leader('07','m');
+
+## LDR 17 - Encoding level ; 7 - minimal level, u - unknown
+marc_leader('17','u');
+
+## LDR 18 - i - isbd
+marc_leader('18','i');
+
+## LDR 19 - Multipart resource record level ; # - Not specified or not applicable, a - Set, b - Part with independent title, c - Part with dependent title
+
+### 003
+marc_fixed('003','00','HR-ZaHPM');
+
+### 008 - All materials
+## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje
+
+if ( rec('100') ) {
+ marc_fixed('008','00',
+ regex('s/^\d\d//',
+ rec('100')
+ ),
+ );
+ marc_fixed('008','02',
+ regex('s/^\d\d\d\d//',
+ rec('100')
+ ),
+ );
+} else {
+ marc_fixed('008','00',
+ '000000'
+ );
+}
+
+
+## 008 06 - Type of date/Publication status
+
+marc_fixed('008','06',
+ 's'
+);
+
+## 008 07-10 - Date 1
+## 008 11-14 - Date 2
+## 210d kroz modify postaje 210c
+
+if ( rec('210','c') ) {
+ my $d1 = '';
+ my $d2 = ' ';
+ if ( rec('210','c') =~ m/(\d{4})-/ ) {
+ marc_fixed('008','06','m');
+ if ( rec('210','c') =~ m/(\d{4})-/ ) {
+ $d1 = $1;
+ $d2 = '9999';
+ }
+ if ( rec('210','c') =~ m/-(\d{4})/ ) {
+ $d2 = $1;
+ }
+ } else {
+ marc_fixed('008','06','s');
+ if ( rec('210','c') =~ m/(\d{4})/ ) {
+ $d1 = $1;
+ }
+ if ( rec('210','c') =~ m/(\d{2})(--|__)/ ) {
+ $d1 = $1.'uu';
+ }
+ if ( rec('210','c') =~ m/(\d{3})(-|_)/ ) {
+ $d1 = $1.'u';
+ }
+ }
+
+ marc_fixed('008','07',$d1); # 07-10 - Date 1
+ marc_fixed('008','11',$d2); # 07-10 - Date 1
+
+} else {
+ marc_fixed('008','06','n'); # 06 - n = unknown date
+ marc_fixed('008','07','uuuu');
+ marc_fixed('008','11',' '); # 07-10 - Date 1
+}
+
+
+## 008 15-17 - Place of publication, production, or execution - ako nema 102, popunjava se s |
+marc_fixed('008','15',
+ rec('102')
+);
+
+## 008 35-37 - Language
+if ( frec('101','a') =~ m/(\w\w\w)/ ) {
+ marc_fixed('008','35', $1 );
+}
+
+## 008 38 - Modified record
+marc_fixed('008','38','|');
+
+## 008 39 - Cataloging source - d (other)
+marc_fixed('008','39','d');
+
+### 008 - Books
+## 008 18-21 - Illustrations
+if ( rec('215','c') && rec('215','c') =~ m/ilustr/ ) {
+ marc_fixed('008','18','a')
+}
+
+## 008 22 - Target audience
+marc_fixed('008','22','|');
+
+## 008 23 - Form of item
+marc_fixed('008','23','|');
+
+## 008 24-27 - Nature of contents
+marc_fixed('008','24','||||');
+
+## 008 28 - Government publication
+marc_fixed('008','28','|');
+
+## 008 29 - Conference publication
+marc_fixed('008','29','|');
+
+## 008 30 - Festschrift
+marc_fixed('008','30','|');
+
+## 008 31 - Index
+marc_fixed('008','31','|');
+
+## 008 32 - Undefined
+## 008 33 - Literary form
+marc_fixed('008','33','|');
+
+## 008 34 - Biography
+marc_fixed('008','34','|');
+
+### 020
+## postoji modify za polje 10 -> drugi ISBN poèinje prefixom "ISBN" koji se mièe (pr. u sfb)
+#if ( frec('10') ne ( frec('290') ) ) {
+ if ( rec('10','a') !~ /pogre/ ) {
+ marc('020','a',
+ # isbn_13(
+ regex('s/\s\s/ /g',
+ # regex('s/\(\d\)\(/$1 \(//g',
+ rec('10','a')
+ )
+ # )
+ );
+ }
+ if ( rec('10','a') =~ /pogre/ ) {
+ marc('020','z',
+ regex('s/\s\s/ /g',
+ rec('10','a')
+ )
+ );
+ }
+ marc('020','z',
+ rec('10','z')
+ );
+#}
+
+### 035
+## marc 035a - System Number
+## polje mo¾e sadr¾avati slova i razmake
+## moguæ problem u pretra¾ivanju ako ima zagrade, kako bi trebalo po standardu
+
+marc('035','a',
+join_with('',
+ # config('input normalize path'),
+ # config('name'),
+ '(HR-ZaHPM)',
+ # config(),
+ # config('input name'),
+ # id(),
+ # rec('994','a'),
+ rec('000')
+ )
+);
+
+### 040
+## za sve je isti
+
+marc('040','a',
+ 'HR-ZaHPM'
+);
+marc('040','b',
+ 'hrv'
+);
+marc('040','c',
+ 'HR-ZaHPM'
+);
+marc('040','e',
+ 'ppiak'
+);
+
+### 041 - indikatori
+## pretpostavke o indikatorima
+## 1. Ako postoji polje 300 i ono sadr¾i /Prijevod/ ili /Izv. stv. nasl./, i1 = 1
+## (Da li je napomena uvijek pisana?)
+## 2. Podatak o prevodiocu u 200g. Problem: razlièiti oblici rijeèi, razlièiti jezici.
+## 3. Ako u UDK oznaci postoji "=", bez zagrada, onda je to prijevod
+## (ako postoje zagrade pr. 94(=411.16) onda su to pomoæne oznake)
+## pr. 821.111-2=163.42 je prijevod engleske drame na HR.
+## to ima samo za knji¾evna djela, eseje....
+## ovo treba kasnije ispravljati
+
+#if ( rec('675') =~ m/\d=\d/ ) ?
+
+### 041
+## ponovljivo polje (101) konvertira se u ponovljivo potpolje (041a)
+## koristi se kad ima vi¹e od jednog jezika, ili kad se radi o prijevodu
+## nadopuniti
+
+
+if ( ( count( rec('101','a') ) > 1 ) || ( rec('101','b') ) || ( rec('101','h') ) ) {
+ marc_original_order('041','101');
+ if ( ( grep( m/prijevod/i, rec('300') ) ) || ( rec('101','h') ) ) {
+ marc_indicators('041', 1, ' ');
+ } else {
+ marc_indicators('041', ' ', ' ');
+ }
+}
+
+
+### 044
+## koristi se kad ima vise zemalja izdavanja
+
+### 080 - UDK
+
+marc('080','a',
+ rec('675')
+);
+
+### 100
+## I1 = 0 ako je pseudonim (ima 700a, nema 700b)
+
+if ( rec('700','a') && ! rec('700','b') ) {
+ marc_indicators('100', 0, ' ');
+} else {
+ marc_indicators('100', 1, ' ');
+}
+
+marc('100','a',
+ join_with(', ',
+ rec('700','a'),
+ rec('700','b')
+ )
+);
+
+### formalna odrednica - iz 503 u 110, i1=0, i2=1
+
+# nadopuniti nakon konverzije
+
+
+### 111 i 110
+## konverzija u 110 ili 111 ovisno o postojanju/nepostojanju nekih polja
+
+if ( ! rec('700') ) {
+
+if ( rec('710','d') || rec('710','e') || rec('710','f') ) {
+
+ marc_indicators('111', 2, ' ');
+
+ if ( rec('710','d') ) {
+ marc_compose('111',
+ 'a', suffix(
+ ( rec('710','d') || rec('710','f') || rec('710','e') ) ? '' :
+ '.',
+ rec('710','a'),
+ ),
+ 'n', surround( '(', ' :',
+ rec('710','d'),
+ ),
+ 'd', suffix(
+ ( ! rec('710','d') ) ? ')' :
+ ( ! rec('710','e') ) ? ')' :
+ ' :',
+ rec('710','f'),
+ ),
+ 'c', suffix(')',
+ rec('710','e'),
+ ),
+ );
+ } else {
+ marc_compose('111',
+ 'a', suffix(
+ ( rec('710','d') || rec('710','f') || rec('710','e') ) ? '' :
+ '.',
+ rec('710','a'),
+ ),
+ 'd', surround('(',' :',
+ rec('710','f'),
+ ),
+ 'c', suffix(')',
+ rec('710','e'),
+ ),
+ );
+ }
+} else {
+ marc_indicators('110', 2, ' ');
+ marc('110','a',
+ rec('710','a')
+ );
+ marc('110','b',
+ rec('710','b')
+ );
+ if ( rec('710','c') ) {
+ marc('110','c',
+ surround('(', ')', rec('710','c'))
+ );
+ }
+}
+
+}
+
+### 245 indikatori
+## i1 = 0 za anonimne publikacije, i1 = 1 ako postoji 700 ili 710
+## i2 = pretpostavlja se na temelju clana na pocetku naslova i jezika
+
+my $titleind1;
+
+if ( rec('700') || rec('710') ) {
+ $titleind1 = 1;
+} else {
+ $titleind1 = 0;
+}
+
+marc_indicators('245', $titleind1, 0);
+
+if ( rec('200','a') =~ m/^Einen / ) {
+ marc_indicators('245', $titleind1, 6);
+}
+if ( rec('200','a') =~ m/^Eine / ) {
+ marc_indicators('245', $titleind1, 5);
+}
+if ( rec('200','a') =~ m/^(Die|Das|Der|Ein|Les|Los|The) / ) {
+ marc_indicators('245', $titleind1, 4);
+}
+if ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Lo|Il) / ) {
+ marc_indicators('245', $titleind1, 3);
+}
+if ( ( rec('101') =~ m/eng/ ) && ( rec('200','a') =~ m/^A / ) ) {
+ marc_indicators('245', $titleind1, 2);
+}
+if ( rec('200','a') =~ m/^L / ) {
+ marc_indicators('245', $titleind1, 2);
+}
+if ( rec('200','a') =~ m/^L'/ ) {
+ marc_indicators('245', $titleind1, 2);
+}
+
+
+### 245
+## postoji modify
+## da li treba makivati razmake u inicijalima?
+
+#_debug(3);
+
+marc_compose('245',
+ 'a', suffix(
+ ( ! ( rec('200','d') || rec('200','e') || rec('200','k') ) ) && ( rec('200','f') ) ? ' /' :
+ ( rec('200','d') ) ? ' =' :
+ ( rec('200','e') ) ? ' :' :
+ ( rec('200','k') ) ? ' ;' :
+ '.',
+ rec('200','a'),
+ ),
+ 'b', suffix(
+ ( rec('200','d') && rec('200','f') ) ? ' /' :
+ ( rec('200','d') && rec('200','c') ) ? '.' :
+ '',
+ rec('200','d'),
+ ),
+ 'b', suffix(
+ ( rec('200','e') && rec('200','f') ) ? ' /' :
+ ( rec('200','e') && rec('200','c') ) ? '.' :
+ '',
+ rec('200','e'),
+ ),
+ 'b', suffix(
+ ( rec('200','k') && rec('200','f') ) ? ' /' :
+ ( rec('200','k') && rec('200','c') ) ? '.' :
+ '',
+ rec('200','k'),
+ ),
+ 'c', suffix(
+ ( rec('200','f') && rec('200','c') ) ? '. ' :
+ '',
+ join_with(' ; ',
+ regex('s/(\S\.)\s(\S\.\s)/$1$2/g',
+ rec('200','f'),
+ ),
+ regex('s/(\S\.)\s(\S\.\s)/$1$2/g',
+ rec('200','g')
+ )
+ )
+ ),
+ ## append to last subfield
+ '+', suffix('.',
+ join_with(' / ',
+ rec('200','c'),
+ rec('200','x')
+ )
+ ),
+);
+
+#_debug(0);
+
+### 250
+## zapisima koji nemaju potpolje, dodaje se ^a u modify - provjeriti za svaku bazu
+marc_compose('250',
+ 'a',suffix(
+ rec('205','f') ? ' / ' :
+ '',
+ rec('205','a')
+ ),
+ 'b', rec('205','f'),
+);
+
+### 260
+## ponovljiva potpolja u originalnom redosljedu - priprema u modify
+marc_original_order('260', '210');
+
+
+### 300
+## urediti interpunkcije za sve kombinacije
+marc('300','a',
+ suffix(
+ rec('215','c') ? ' :' :
+ rec('215','d') ? ' ;' :
+ rec('215','e') ? ' +' :
+ '',
+ rec('215','a')
+ )
+);
+marc('300','b',
+ suffix(
+ ( rec('215','c') && rec('215','d') ) ? ' ;' :
+ ( rec('215','c') && rec('215','e') ) ? ' +' :
+ '',
+ rec('215','c')
+ )
+);
+marc('300','c',
+ suffix(
+ rec('215','e') ? ' +' :
+ '',
+ rec('215','d')
+ )
+);
+marc('300','e',
+ rec('215','e')
+);
+
+
+if ( rec('225') ) {
+ marc_indicators('490', 0, ' ');
+ marc('490','a',
+ rec('225','a')
+ );
+ marc('490','v',
+ rec('225','v')
+ );
+}
+
+# marc_indicators('830',' ','0');
+# i2 ovisi èlanu - popraviti
+#
+# marc('830','a',
+# regex('s/(^.*)\s\/\s(.*)/$1 ($2)/g',
+# rec('225','a')
+# )
+# );
+
+
+### 830 - indikatori
+## 2.ind. prema jeziku i clanu, uskladiti s 245
+
+#marc_indicators('440', ' ', '0');
+#
+#if ( rec('225','a') =~ m/^Einen / ) {
+# marc_indicators('440', ' ', 6);
+#}
+#
+#if ( rec('225','a') =~ m/^Eine / ) {
+# marc_indicators('440', ' ', 5);
+#}
+#
+#if ( rec('225','a') =~ m/^(Die|Das|Der|Ein|Les|The) / ) {
+# marc_indicators('440', ' ', 4);
+#}
+#
+#if ( rec('225','a') =~ m/^(Um|Un|An|La|Le|Il) / ) {
+# marc_indicators('440', ' ', 3);
+#}
+#
+#if ( rec('225','a') =~ m/^(A|L') / ) {
+# marc_indicators('440', ' ', 2);
+#}
+
+#if (
+# count( lookup(
+# sub { 1 },
+# 'ffps','libri',
+# sub { rec('225','a') }
+# ) ) > 1
+#) {
+
+
+#_debug(0);
+
+
+### 500
+
+marc('500','a',
+ rec('300')
+);
+
+### 502 - bilje¹ka o disertacijama
+## odgovarajuæeg polja nema u originalnim podacima. mo¾da se mo¾e pretpostaviti?
+
+### 504
+marc('504','a',
+ rec('320')
+);
+
+
+### 653 - Index Term-Uncontrolled
+## da li ponovljivo polje ili potpolje, pogledati u Koha tags
+marc_indicators('653', ' ', ' ');
+marc('653','a',
+ rec('610')
+);
+
+
+#_debug(2);
+
+
+### 700
+## ako je u originalu ponovljivo polje treba bioti i konvertirano u ponovljivo !!
+## ako ima samo podpolje a onda je pseudonim - nakon konverzije treba provjeriti
+
+if ( rec('700','c') ) {
+ if ( rec('700','c') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('700','c'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('700','e') ) {
+ if ( rec('700','e') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('700','e'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('700','g') ) {
+ if ( rec('700','g') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('700','g'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('700','i') ) {
+ if ( rec('700','i') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('700','i'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('700','k') ) {
+ if ( rec('700','k') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('700','k'),
+ '4', 'aut'
+ );
+}
+
+
+if ( rec('701','a') ) {
+ marc_indicators('700', 1, ' ');
+ marc('700','a',
+ rec('701','a')
+ );
+}
+
+if ( rec('701','c') ) {
+ if ( rec('701','c') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('701','c'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('701','e') ) {
+ if ( rec('701','e') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('701','e'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('701','g') ) {
+ if ( rec('701','g') =~ m/, / ) {
+ marc_indicators('700', 1, ' ');
+ } else {
+ marc_indicators('700', 0, ' ');
+ }
+ marc_compose('700',
+ 'a', rec('701','g'),
+ '4', 'aut'
+ );
+}
+
+if ( rec('702','a') ) {
+ marc_indicators('700', 1, ' ');
+ marc('700','a',
+ rec('702','a'),
+ );
+}
+
+if ( rec('702','c') ) {
+ marc_indicators('700', 1, ' ');
+ marc('700','a',
+ rec('702','c'),
+ );
+}
+
+if ( rec('702','e') ) {
+ marc_indicators('700', 1, ' ');
+ marc('700',
+ 'a', rec('702','e'),
+ );
+}
+
+
+#_debug(0);
+
+## eventualno nadopuniti 710 i 711 - provjetiti da li u podacima postoji u ISIS-u
+
+if ( rec('700') ) {
+
+if ( rec('710','d') || rec('710','e') || rec('710','f') ) {
+
+marc_indicators('711', 2, ' ');
+
+marc_compose('711',
+ 'a', suffix(
+ rec('710','b') ? '.' :
+ '',
+ rec('710','a'),
+ ),
+ 'e', rec('710','b'),
+ 'n', prefix(
+ rec('710','d') ? '(' :
+ '',
+ rec('710','d')
+ ),
+ 'd', prefix(
+ ( ! rec('710','d') ) ? '(' :
+ ( ! rec('710','e') ) ? '(' :
+ '; ',
+ rec('710','f'),
+ ),
+ 'c', prefix(
+ ( rec('710','e') && ( rec('710','d') || rec('710','f') ) ) ? '; ' :
+ ( ! rec('710','d') && ! rec('710','f') ) ? '(' :
+ '',
+ rec('710','e'),
+ ),
+ '+',')',
+);
+} else {
+ marc_indicators('710', 2, ' ');
+ marc('710','a',
+ rec('710','a')
+ );
+ marc('710','b',
+ rec('710','b')
+ );
+ if ( rec('710','c') ) {
+ marc('710','c',
+ surround('(', ')', rec('710','c'))
+ );
+ }
+}
+
+}
+
+
+### 740 - Added Entry - Uncontrolled Related/Analytical Title
+## raspraviti
+## nadopuniti prvi indikator prema èlanovima
+marc_indicators('740', '0', ' ');
+
+# if ( ! rec('464') ) {
+# marc('740','a',
+# rec('200','c')
+# );
+
+#marc('740','a',
+# rec('200','k')
+#);
+
+# } else {
+
+#marc('740','a',
+# rec('464','a')
+#);
+
+# };
+
+### 760 w ---------------------------------------------
+## generiranje zapisa o nakladnièkoj cjelini i povezivanje podreðenog zapisa s nadreðenim
+
+#if (
+# rec('225','a') # da li je nakladnièka cjelina?
+#) {
+
+#my $series_key =
+#join_with('',
+# rec('225','a'),
+# rec('210','a'),
+# rec('210','b'),
+#);
+#
+#my $series = get( $series_key );
+#
+#if ($series) {
+# warn "nije novi";
+#} else {
+#
+#$series = join_with('',
+# uc( config() ),
+# ' LS',
+# rec('000')
+#);
+#
+#set( $series_key => $series );
+#
+#} # $series
+#} # nakladnièka cjelina
+#
+#my $series_key = join_with('',
+# rec('225','a'),
+# rec('210','a'),
+# rec('210','b'),
+#);
+#
+#if ($series_key) {
+#
+# marc_indicators('760', 0, ' ');
+#
+# marc('760','t',
+# rec('225','a')
+# );
+# marc('760','w',
+# get( $series_key )
+# );
+#}
+
+# ## testing
+#
+# my $dup_key = join_with('',
+# rec('200','a'),
+#);
+#
+#if ($dup_key) {
+# marc('995','a',
+# get( $dup_key )
+# );
+#}
+#
+#
+# marc_indicators('776', 0, ' ');
+#
+# marc('776','a',
+# rec('452','1')
+# );
+#
+# -------------------------------------------------------------------
+
+### 774 - Constituent Item Entry - to bi trebali koristiti ali ne koristimo jer NSK to koristi za ne¹to drugo
+### 787 - Nonspecific Relationship Entry
+
+#marc_indicators('787','0',' ');
+#
+#marc_compose('787',
+# 'g', rec('230','v'),
+# 't', rec('230','a'),
+# 'b', rec('240','a'),
+# 'd', rec('250','a'),
+# 'd', rec('250','d'),
+# 'h', rec('260','a'),
+# 'k', rec('270','a'),
+# 'n', join_with('. - ',
+# rec('280'),
+# ),
+# 'x', join_with(', ',
+# rec('290'),
+# )
+#);
+#marc_compose('787',
+# 'g', rec('231','v'),
+# 't', rec('231','a'),
+# 'b', rec('241','a'),
+# 'd', rec('251','a'),
+# 'd', rec('251','d'),
+# 'h', rec('261','a'),
+# 'k', rec('271','a'),
+# 'n', join_with('. - ',
+# rec('281'),
+# ),
+# 'x', join_with(', ',
+# rec('291'),
+# )
+#);
+#marc_compose('787',
+# 'g', rec('232','v'),
+# 't', rec('232','a'),
+# 'b', rec('242','a'),
+# 'd', rec('252','a'),
+# 'd', rec('252','d'),
+# 'h', rec('262','a'),
+# 'k', rec('272','a'),
+# 'n', join_with('. - ',
+# rec('282'),
+# ),
+# 'x', join_with(', ',
+# rec('292'),
+# )
+#);
+#marc_compose('787',
+# 'g', rec('233','v'),
+# 't', rec('233','a'),
+# 'b', rec('243','a'),
+# 'd', rec('253','a'),
+# 'h', rec('263','a'),
+# 'k', rec('273','a'),
+# 'n', join_with('. - ',
+# rec('283'),
+# ),
+# 'x', join_with(', ',
+# rec('293'),
+# )
+#);
+
+
+### 852 - ne koristimo, koristimo 942 i 952
+
+### 876 - item information - basic bibliographic unit (R)
+## da li ovdje zapisati stare inventarne brojeve?
+#marc('876','a',
+# rec('991','t'),
+#);
+
+### 886 - former marc
+# inicijale treba prebaciti u neko lokalno polje, a ovo polje nam ne treba
+#
+# marc_indicators('886', 2, ' ');
+# marc('886','2',
+# 'ffmarc'
+# );
+# marc('886','a',
+# '994'
+# );
+# marc('886','b',
+# join_with(''.
+# '##^a',
+# join_with('',
+# prefix('^a',
+# rec('994','a'),
+# ),
+# prefix('^b',
+# rec('994','b')
+# )
+# )
+# )
+#);
+
+### KOHA items
+
+marc('942','b',
+ 'LIB'
+);
+
+marc('942','c',
+ 'K'
+);
+
+marc('952','a',
+ 'HPM'
+);
+marc('952','b',
+ 'HPM'
+);
+marc('952','e',
+ rec('991','a')
+);
+marc('952','t',
+ rec('991','b')
+);
+marc('952','o',
+ rec('990')
+);
+
+
+
+
+
+
+} # polje 200a