2 use strict; use warnings;
4 use OpenILS::Utils::Fieldmapper;
6 my $map = $Fieldmapper::fieldmap;
8 # if a true value is provided, we generate the web (light) version of the fieldmapper
10 if(!$web) { $web = ""; }
12 # List of classes needed by the opac
13 my @web_hints = qw/ asv asva asvr asvq
14 circ acp acpl acn ccs ahn
15 crcd crmf crrf mbts aoc aus
16 mous mobts cdreb cdrebi /;
18 my @web_core = qw/ aou au perm_ex ex aout mvr ccs ahr aua ac actscecm /;
20 my @reports = qw/ perm_ex ex ao aou aout /;
23 print "var _c = {};\n";
25 for my $object (keys %$map) {
28 my $hint = $map->{$object}->{hint};
29 next unless (grep { $_ eq $hint } @web_hints );
32 if($web eq "web_core") {
33 my $hint = $map->{$object}->{hint};
34 next unless (grep { $_ eq $hint } @web_core );
37 if($web eq "reports") {
38 my $hint = $map->{$object}->{hint};
39 next unless (grep { $_ eq $hint } @web_core );
43 my $short_name = $map->{$object}->{hint};
46 for my $field (keys %{$map->{$object}->{fields}}) {
47 my $position = $map->{$object}->{fields}->{$field}->{position};
48 $fields[$position] = $field;
51 print "_c[\"$short_name\"] = [";
53 if( $f ne "isnew" and $f ne "ischanged" and $f ne "isdeleted" ) {
62 print "fmclasses = _c;\n";