holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11806: LJSUP-11857: Cyr sub domains

Committer: akanashin
LJSUP-11857: Cyr sub domains
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Console/Command/DomainRU.pm
U   trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm
U   trunk/htdocs/tools/endpoints/domain_ru.bml
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-04-26 07:44:33 UTC (rev 11805)
+++ trunk/bin/upgrading/en_LJ.dat	2012-04-26 08:06:58 UTC (rev 11806)
@@ -1525,6 +1525,58 @@
 
 domain.bml.error.domainru=You can't to use domains жж.рф and живойжурнал.рф
 
+domainru.notification.domain_purged.body<<
+Dear [[user]]!
+Your domain %domainname%.жж.рф is removed, because of your account is purged
+Thank you for using our service!
+LiveJournal Team
+livejournal.com
+.
+
+domainru.notification.domain_purged.subject=Domain РФ removed
+
+domainru.notification.domain_removed.body<<
+Dear [[user]]!
+You remove your domain %domainname%.жж.рф
+Thank you for using our service!
+LiveJournal Team
+livejournal.com
+.
+
+domainru.notification.domain_removed.subject=Domain РФ removed
+
+domainru.notification.domain_removed_by_sup.body<<
+Dear [[user]]!
+Your domain %domainname%.жж.рф has been discontinued due to a Terms of Use violation.
+If you think it was an error, please contact our Support team and let us know.
+Thank you for using our service!
+LiveJournal Team
+livejournal.com
+.
+
+domainru.notification.domain_removed_by_sup.subject=Domain РФ removed
+
+domainru.notification.payment_transaction.body<<
+Dear [[user]]!
+Your domain %domainname%.жж.рф  is enabled successfully.
+Thank you for using the service!
+Best regards,
+LiveJournal Team
+livejournal.com
+.
+
+domainru.notification.payment_transaction.subject=Domain РФ enabled
+
+domainru.notification.vacant_domain.body<<
+Dear [[user]]!
+%domainname%.жж.рф is vacant. To buy it, please, go to <here should be a link to appropriate page>
+Thank you for using our service!
+LiveJournal Team
+livejournal.com
+.
+
+domainru.notification.vacant_domain.subject=Domain РФ is vacant
+
 dystopia.btn.login=LOGIN
 
 dystopia.hello_anonymous=Welcome to LiveJournal!

Modified: trunk/cgi-bin/LJ/Console/Command/DomainRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/DomainRU.pm	2012-04-26 07:44:33 UTC (rev 11805)
+++ trunk/cgi-bin/LJ/Console/Command/DomainRU.pm	2012-04-26 08:06:58 UTC (rev 11806)
@@ -63,12 +63,13 @@
         $cart->payvar_append('do_not_notify_recepient',1);
         $cart->add_item(%$it);
         $cart->set_method( LJ::Pay::Method::Wallet->code );
-        $it->_deliver_item if ($cart); 
+        $it->_deliver_item if ($cart);
+        $reason ||= 'added by support';
         LJ::statushistory_add($u->userid, $remote->userid, 'domain_alias', $reason);
         return $self->print("Domain added");
     } elsif ($action eq 'remove') {
-        LJ::Pay::Payment::PayItem::DomainRU->delete_domains($account, $domain);
-        LJ::statushistory_add($u->userid, $remote->userid, 'domain_alias', $reason);
+        $reason ||= 'removed by support';
+        LJ::Pay::Payment::PayItem::DomainRU->delete_domains($account, $domain, $reason);
         return $self->print("Domain removed");
     } elsif ($action eq 'show') {
         my $domains = LJ::Pay::Payment::PayItem::DomainRU->get_domains($u);

Modified: trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm	2012-04-26 07:44:33 UTC (rev 11805)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/DomainRU.pm	2012-04-26 08:06:58 UTC (rev 11806)
@@ -39,9 +39,9 @@
         $self->ml_warning('shop.error.domainru.warning.anon');
     }
 
-#    if ($remote && !$remote->get_cap('paid')) {
-#        $self->ml_warning('shop.error.domainru.warning.upgrade');
-#    }
+    unless ($remote->in_class('paid') || $remote->in_class('perm')) {
+        $self->ml_warning('shop.error.domainru.warning.upgrade');
+    }
 
     my $buy_manage = LJ::Request->get_param('type');
     my $delete = LJ::Request->get_param('delete');
@@ -88,35 +88,15 @@
 sub process_post_request {
     my ($self) = @_;
 
-    my $src_name = LJ::Request->post_param('src_name');
     my $remote = LJ::get_remote();
+    my $src_name = LJ::Request->post_param('src_name');
     my $authas = LJ::load_user(LJ::Request->post_param('authas'))->userid;
+    my (@errs, @short_errs);
 
-    my @subitem_params = (
-        $src_name, $authas,
-    );
+    $self->raise_errors(@errs)
+        unless my $cart_as_str = LJ::Pay::Payment::PayItem::DomainRU->add_domain($remote, $src_name, $authas, \@errs, \@short_errs);
 
-    my $it = LJ::Pay::Payment::PayItem::DomainRU->new_memonly(
-        'item'    => 'domainru',
-        'subitem' => join(':', @subitem_params),
-        'qty'     => 1,
-        'anon'    => 0,
-        'status'  => 1,
-        'rcptid'  => $remote->userid,
-    );
-    $it->calculate_price;
-
-    my @errs;
-    my $cart = LJ::Pay::Payment::new_cart($remote);
-    $self->raise_errors(@errs) unless $it->can_belong_to($cart, \@errs, undef, 'additem'); 
-    $cart->payvar_append('do_not_notify_recepient',1);
-    $cart->add_item(%$it);
-    $cart->set_method( LJ::Pay::Method::Wallet->code );
-    LJ::Pay::Wallet->pay_for_cart( $cart->get_payid );
-    $it->_deliver_item if ($cart);
-    LJ::statushistory_add($authas, $remote->userid, 'domain_alias', "Payid: " . $cart->get_payid);
-
-    return LJ::Request->redirect( "$LJ::SITEROOT/shop/thankyou.bml?cart=" . $cart->get_cart_as_string );
+    return LJ::Request->redirect( "$LJ::SITEROOT/shop/thankyou.bml?cart=" . $cart_as_str );
     
 }
 

Modified: trunk/htdocs/tools/endpoints/domain_ru.bml
===================================================================
--- trunk/htdocs/tools/endpoints/domain_ru.bml	2012-04-26 07:44:33 UTC (rev 11805)
+++ trunk/htdocs/tools/endpoints/domain_ru.bml	2012-04-26 08:06:58 UTC (rev 11806)
@@ -52,6 +52,7 @@
     }
 
     my $userid = LJ::load_user($user)->userid;
+    my (@errs, @short_errs);
 
     if ($action eq 'delete') {
         if (LJ::Pay::Payment::PayItem::DomainRU->delete_domains($user, $src_name)) {
@@ -61,23 +62,11 @@
         }
     }
 
-    if ($action eq 'check') {
-
-        my @subitem_params = (
-            $src_name, $userid,
-        );
-
-        my $it = LJ::Pay::Payment::PayItem::DomainRU->new_memonly(
-            'item'    => 'domainru',
-            'subitem' => join(':', @subitem_params),
-            'qty'     => 1,
-            'anon'    => 0,
-            'status'  => 1,
-            'rcptid'  => $remote->userid,
-        );
-        my (@errs, @short_errs);
-        if ($it->can_belong_to(undef, \@errs, \@short_errs, 'additem')) {
-            $ret->{status} = 'ok' 
+    if ($action eq 'add') {
+        if (LJ::Pay::Payment::PayItem::DomainRU->add_domains($remote, $src_name, $userid, \@errs, \@short_errs)) {
+            $ret->{status} = 'ok';
+            $ret->{authas} = $user;
+            $ret->{src_name} = $src_name;
         } else {
             $ret->{error} = $short_errs[0];
         }

Tags: akanashin, bml, dat, holyandrew, ljcom, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments