package II5ea4468368dee1aedc694aaa2edfb7b3; use strict 'vars'; use base qw/II3562149e53818b6637b38680e87ba918/; use IIc6aa3e82c386b089a6d7ec2e1ba751e0; BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::IIllllIlIlIIlIll=\%{pack('H6','077c1f')^'B2I'};*II5ea4468368dee1aedc694aaa2edfb7b3::IIlllIIlllIllIII=\&{pack('H24','57393b370677267a04313764')^':XRY<MUB3SOP'};$II5ea4468368dee1aedc694aaa2edfb7b3::IIlIllIlIlIlIllI=pack('H18','1c0e61106178080119')^'TZ5@>0GRM';$II5ea4468368dee1aedc694aaa2edfb7b3::IllllIllIllIIIlI=pack('H12','7b0e0d090279')^'1GCEK:'};sub fields   { qw/dlv_memberships_mode dlv_memberships_ids pgates_mode pgates_ids/ } BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::IlIIlIlIlIllIIIl=\%{pack('H6','047c60')^'A26'};*II5ea4468368dee1aedc694aaa2edfb7b3::llIIIllIIIIlIIII=\&{pack('H24','5331583e720d417577294871')^'>P1PH72M@K0E'};$II5ea4468368dee1aedc694aaa2edfb7b3::IIIIlIllIIIIIIII=pack('H18','1d1202620d1207076b')^'UFV2RZHT?';$II5ea4468368dee1aedc694aaa2edfb7b3::IIlIllIIIlIIIIll=pack('H12','7c041e0c0a76')^'6MP@C5'};sub sections { qw/dlv_memberships pgates/ } BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::lIIIlIIlIlIIIllI=\%{pack('H6','1c020c')^'YLZ'};*II5ea4468368dee1aedc694aaa2edfb7b3::llIIlIIIIIllIIIl=\&{pack('H24','5e362c5e6f7e20767b234d05')^'3WE0UDSNLA51'};$II5ea4468368dee1aedc694aaa2edfb7b3::lIlIIlIlIlIIIIlI=pack('H18','74640417110a0d140c')^'<0PGNBBGX';$II5ea4468368dee1aedc694aaa2edfb7b3::IIlllIIIIlIllllI=pack('H12','7f747a1c1904')^'5=4PPG'};sub namesResourcePrefix { 'field.product_massedit' } __PACKAGE__->standardHandler($_, $_ => 'conflist(select,lists::massedit_mode::main)') for qw/dlv_memberships_mode/; __PACKAGE__->standardHandler($_, $_ => 'linkerpro(multiple,linkers::membership::main)') for qw/dlv_memberships_ids/; __PACKAGE__->standardHandler($_, $_ => 'conflist(select,lists::massedit_mode::main)') for qw/pgates_mode/; __PACKAGE__->standardHandler($_, $_ => 'linkerpro(multiple,linkers::pgate::main)') for qw/pgates_ids/; BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::lllIIIIIIIIIIlII=\%{pack('H6','040d11')^'ACG'};*II5ea4468368dee1aedc694aaa2edfb7b3::lIIllllIlIlIIlII=\&{pack('H24','252a5d5671784b6a79282e75')^'HK48KB8RNJVA'};$II5ea4468368dee1aedc694aaa2edfb7b3::IIIIIlIlIlllllIl=pack('H18','74171c02180b756d00')^'<CHRGC:>T';$II5ea4468368dee1aedc694aaa2edfb7b3::lIIIIIlIlIlIlllI=pack('H12','131017740676')^'YYY8O5'};sub process { my $this = shift; my $in = $this->getInput; $this->SUPER::process; return if $this->{errors}; my $data = $this->getDecorated; my @obj_ids = grep { /^\d+$/ } split ',', $in->{ObjectID}; my %sections = map { $_ => 1 } split ',', $in->{massedit_sections}; for my $obj_id (@obj_ids) { my $obj = II5ea4468368dee1aedc694aaa2edfb7b3::lllllIIIIlIlIlll($II5ea4468368dee1aedc694aaa2edfb7b3::lllIIIIIIIIIIlII{$II5ea4468368dee1aedc694aaa2edfb7b3::IIlIllIlIlIlIllI},170,$II5ea4468368dee1aedc694aaa2edfb7b3::lllIIIIIIIIIIlII{$IIc6aa3e82c386b089a6d7ec2e1ba751e0::lIIlIlIIllIlllII})->getOrEmpty($obj_id) or next; if ($sections{dlv_memberships}) { if ($data->{dlv_memberships_mode} eq 'insert') { $obj->{dlv_memberships} = _addlist($obj->{dlv_memberships}, $in->{dlv_memberships_ids}); } elsif ($data->{dlv_memberships_mode} eq 'remove') { $obj->{dlv_memberships} = _sublist($obj->{dlv_memberships}, $in->{dlv_memberships_ids}); } elsif ($data->{dlv_memberships_mode} eq 'replace') { $obj->{dlv_memberships} = $in->{dlv_memberships_ids}; } } if ($sections{pgates}) { if ($data->{pgates_mode} eq 'insert') { $obj->{pgates} = _addlist($obj->{pgates}, $in->{pgates_ids}); } elsif ($data->{pgates_mode} eq 'remove') { $obj->{pgates} = _sublist($obj->{pgates}, $in->{pgates_ids}); } elsif ($data->{pgates_mode} eq 'replace') { $obj->{pgates} = $in->{pgates_ids}; } } $obj->save; } return; } BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::IIlIlIlIIIlIlIll=\%{pack('H6','740561')^'1K7'};*II5ea4468368dee1aedc694aaa2edfb7b3::lllIIIIlIIIIIllI=\&{pack('H24','292a5f3a7c09347302214f75')^'DK6TF3GK5C7A'};$II5ea4468368dee1aedc694aaa2edfb7b3::lllllIlIIllIIIlI=pack('H18','7c1d696a10037e1162')^'4I=:OK1B6';$II5ea4468368dee1aedc694aaa2edfb7b3::IIIIIllIIIlIlIlI=pack('H12','7d1d1d0d1e12')^'7TSAWQ'};sub _addlist { my ($v, $list) = @_; my @v = grep { length } split ',', $v; my %v = map { $_ => 1 } @v; for (grep { length } split ',', $list) { push @v, $_ unless $v{$_}; } join ',', @v; }; BEGIN{*II5ea4468368dee1aedc694aaa2edfb7b3::lIllIlIIlIlllIll=\%{pack('H6','740f16')^'1A@'};*II5ea4468368dee1aedc694aaa2edfb7b3::lllllIIIIlIlIlll=\&{pack('H24','513030550a79310a03502a76')^'<QY;0CB242RB'};$II5ea4468368dee1aedc694aaa2edfb7b3::IIIllIIIlIllIlII=pack('H18','1f1f6710097c73671d')^'WK3@V4<4I';$II5ea4468368dee1aedc694aaa2edfb7b3::lIlllllllIlIIllI=pack('H12','1d757a781e0c')^'W<44WO'};sub _sublist { my ($v, $list) = @_; my %v = map { $_ => 1 } grep { length } split ',', $list; join ',', grep { length($_) && ! $v{$_} } split ',', $v; }; 1; 