package IIb02f8d3064e235967de5c537b3e7ce9b::mod_membership; use strict; use IIf6c7e28bdd48eb29efc7b9362c0037a2; sub cfgEditCtime { 1 } sub createAllForSale { my $class = shift; my ($dlv_class, $sale) = @_; my $prod = $sale->getProduct; return unless $prod->{dlv_memberships}; for my $mid (split(',', $prod->{dlv_memberships})) { my $membership = II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIIllIIllIlIIll($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIlIlIlIlIll{$IIb39071a48a82a07eeb9256f406abebc5::llllIIllIIIIIIIl},162,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIlIlIlIlIll{$II720d6e18aa34327713eb014408fc9144::llIIIIIlllllIlIl})->get($mid); next if ! $membership->stored || $membership->{type} eq 'extmem' && ! $prod->getSys->getAdmin->getPrivs->{master_store_extscripts}; $dlv_class->create($sale->getUser, 'membership', $membership->id, $sale->getValidUntilDate, $sale->{id}); } return; } sub save { my $class = shift; my $dlv_object = shift; return if $dlv_object->stored; my $mem = $dlv_object->getStoreObject; my $url = $mem->{url}; my $user = $dlv_object->getUser; II720d6e18aa34327713eb014408fc9144::lIIlIIlIIIIlIIIl($II720d6e18aa34327713eb014408fc9144::IlIlIllIlIlIIlll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIIlIlIlIlIIIl},8,$II720d6e18aa34327713eb014408fc9144::IlIlIllIlIlIIlll{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIlIlIIIIllIIIl})->send($user->{email}, $mem->{email_access}, { SaleDescription => $dlv_object->getView->getSaleDescription, MembershipURL => $url, Customer => $user->getView, }); $dlv_object->{obj_title} ||= $url; return; } sub delete { my $class = shift; my $dlv_object = shift; my $mem = $dlv_object->getStoreObject; my $user = $dlv_object->getUser; II982446f8950cc3dc59e487adba22df54::lllllIllIlIllllI($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$II720d6e18aa34327713eb014408fc9144::IlIlIllIIIIIllll},8,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$IIb39071a48a82a07eeb9256f406abebc5::lllllIllIllIIllI})->send($user->{email}, $mem->{email_delete}, { SaleDescription => $dlv_object->getView->getSaleDescription, MembershipURL => $mem->{url}, Customer => $user->getView, }); return; } sub activateDlv { my $class = shift; my $dlv_object = shift; $dlv_object->getStoreObject->activateDlv($dlv_object); return; } sub deactivateDlv { my $class = shift; my $dlv_object = shift; $dlv_object->getStoreObject->deactivateDlv($dlv_object); return; } sub deleteDlv { my $class = shift; my $dlv_object = shift; $class->deactivateDlv($dlv_object); return; } sub getStoreObject { my $class = shift; my $dlv_object = shift; II8dae0e141ee45f5daba6a74e4a7c3b6f::lllIlIIIIlIIlIll($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIIIIIIIllIIIIIl},162,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$IIb39071a48a82a07eeb9256f406abebc5::lllIIlIIIlllIIIl})->getOrDummy($dlv_object->{obj_id}); } sub getTitle { my $class = shift; my $dlv_object = shift; $class->getStoreObject($dlv_object)->{url}; } sub getLoginNameForUser { my $class = shift; my ($dlv_object, $user) = @_; $class->getStoreObject($dlv_object)->getLoginNameForUser($user); } 1; 