package II0b5abbbec11e0dde5602ebb7c4f9bcb7; use strict 'vars'; use base qw/II3562149e53818b6637b38680e87ba918/; use II3562149e53818b6637b38680e87ba918::perllist; use II8b55f24974af3d53369c3d9cea404f55::filters::text2xml; BEGIN{*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IIllIllllIIlllII=\%{pack('H6','0d7a62')^'H44'};*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlIlIlllIllIlllI=\&{pack('H24','2f32592b6a794d600c5a3303')^'BS0EPC>X;8K7'};$II0b5abbbec11e0dde5602ebb7c4f9bcb7::lIlllIIlIIIlIIII=pack('H18','040c1f096f7f1a1003')^'LXKY07UCW';$II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlllIlIIlIIIIIll=pack('H12','7f1818141d0d')^'5QVXTN'};sub fields    { qw/data/ } BEGIN{*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IIIlIlIllIIIllll=\%{pack('H6','141414')^'QZB'};*II0b5abbbec11e0dde5602ebb7c4f9bcb7::llIIIlIlIlllllII=\&{pack('H24','3b2d54537969446e6d5a4e02')^'VL==CS7VZ866'};$II0b5abbbec11e0dde5602ebb7c4f9bcb7::lIllIIllllIIlIIl=pack('H18','740468091f0d7e126c')^'<P<Y@E1A8';$II0b5abbbec11e0dde5602ebb7c4f9bcb7::lllIIllIIlIIlIIl=pack('H12','7e09171c7a02')^'4@YP3A'};sub required  { qw// } BEGIN{*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlllIIlllIlllIll=\%{pack('H6','151604')^'PXR'};*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IllIIlllIlIllIII=\&{pack('H24','235e2c57096c210e06583b73')^'N?E93VR61:CG'};$II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlIIIIIIIlIlIlIl=pack('H18','706561101b7c016504')^'815@D4N6P';$II0b5abbbec11e0dde5602ebb7c4f9bcb7::lIIIIlllIIlIlIII=pack('H12','0b1f7f090a76')^'AV1EC5'};sub getData { my $this = shift; my $object = $this->getDecorated; my $view = $object->getView; my $data = $view->getData; my $code = ''; my $seq = 0; my @seqValues = 1 .. scalar(@{ $data->{List} }); my %seqLabels = map { $_ => $_ } @seqValues; for my $f (@{ $data->{List} }) { $seq++; my $fd = $data->{Fields}{$f}; my %checked = map { $_ => ($fd->{$_} ? 'checked' : '') } qw/enabled mandatory/; my $quotedTitle = II8b55f24974af3d53369c3d9cea404f55::filters::text2xml::text2xml($fd->{title}); my $controlEnabled = $fd->{enabled_lock} ? qq(<input type="checkbox" $checked{enabled} disabled>) . ($checked{enabled} ? qq(<input type="hidden" name="data_enabled" value="$f">) : '') : qq(<input type="checkbox" name="data_enabled" value="$f" $checked{enabled}>); my $controlMandatory = $fd->{mandatory_lock} ? qq(<input type="checkbox" $checked{mandatory} disabled>) . ($checked{mandatory} ? qq(<input type="hidden" name="data_mandatory" value="$f">) : '') : qq(<input type="checkbox" name="data_mandatory" value="$f" $checked{mandatory}>); my @values = split ',', $fd->{types}; my %labels = map { $_ => $data->{Types}{$_}{title} } @values; my $selectorType = II3562149e53818b6637b38680e87ba918::perllist::buildList('select', "data_type_$f", $fd->{type}, \@values, \%labels); my $selectorSeq = II3562149e53818b6637b38680e87ba918::perllist::buildList('select', "data_seq_$f", $seq, \@seqValues, \%seqLabels); $code .= <<END_CODE;
<tr>
<td>$selectorSeq</td> <td align="center">$controlEnabled</td> <td><input type="text" size="30" name="data_title_$f" value="$quotedTitle"></td> <td>$selectorType</td> <td align="center">$controlMandatory</td>
</tr>		
END_CODE
} $code; } BEGIN{*II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlIIIIlIIlIIIlIl=\%{pack('H6','067060')^'C>6'};*II0b5abbbec11e0dde5602ebb7c4f9bcb7::lIIIlIIIIIllIlIl=\&{pack('H24','2e2c255d6b71330e76513274')^'CML3QK@6A3J@'};$II0b5abbbec11e0dde5602ebb7c4f9bcb7::lIIIIIIIlllIIIII=pack('H18','7369071f6e031a6103')^';=SO1KU2W';$II0b5abbbec11e0dde5602ebb7c4f9bcb7::IlIIIlIlIlIlllIl=pack('H12','08180a04117d')^'BQDHX>'};sub setData { my $this = shift; my $v = shift; my $object = $this->getDecorated; my $view = $object->getView; my $data = $view->getDataDefault; my @amend; my %enabled = map { $_ => 1} split ',', $v->{enabled}; my %mandatory = map { $_ => 1} split ',', $v->{mandatory}; my %seq; for my $f (@{ $data->{List} }) { my $fd = $data->{Fields}{$f}; my $enabled = $enabled{$f} ? 1 : 0; my $mandatory = $mandatory{$f} ? 1 : 0; push @amend, "Fields.$f.title=".$v->{"title_$f"} unless $fd->{title} eq $v->{"title_$f"}; push @amend, "Fields.$f.type=".$v->{"type_$f"} unless $fd->{type} eq $v->{"type_$f"}; push @amend, "Fields.$f.enabled=$enabled" unless ($fd->{enabled} + 0)  == $enabled; push @amend, "Fields.$f.mandatory=$mandatory" unless ($fd->{mandatory} + 0)  == $mandatory; $seq{$f} = $v->{"seq_$f"}; } my $listDefault = join ',', @{ $data->{List} }; my $listCustom = join ',', sort { $seq{$a} <=> $seq{$b} } keys %seq; push @amend, "List=$listCustom" unless $listDefault eq $listCustom; $object->{data} = join "\n", @amend; return; } 1; 