sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r12805: LJSUP-13935: Show correct Journal Promo ...

Committer: vtroitsky
LJSUP-13935: Show correct Journal Promo transactions in the user's wallet history
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
U   trunk/cgi-bin/LJ/Widget/Shop/History.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-10-22 14:53:50 UTC (rev 12804)
+++ trunk/bin/upgrading/en_LJ.dat	2012-10-22 15:01:43 UTC (rev 12805)
@@ -17280,6 +17280,9 @@
 wallet.widget.history.des.order|staleness=1
 wallet.widget.history.des.order=<a href="[[cart_link]]">Order in LJ Shop</a>
 
+wallet.widget.history.des.order.journal|staleness=1
+wallet.widget.history.des.order.journal=<a href="[[cart_link]]">Order in LJ Shop</a> for promotion of the <a href="[[object_url]]">entry</a> on [[journal]]
+
 wallet.widget.history.des.paid_repost|staleness=1
 wallet.widget.history.des.paid_repost=Give to [[to]] for repost of <a href="[[url]]">entry</a>
 

Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-10-22 14:53:50 UTC (rev 12804)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-10-22 15:01:43 UTC (rev 12805)
@@ -100,7 +100,8 @@
 }
 
 =item get_wallet_history_desc
-    TODO:  !!!!
+
+    misc - log item misc flag
 =cut
 sub get_wallet_history_desc {
     my ($self, $buyer, $misc) = @_;
@@ -114,7 +115,7 @@
                 return LJ::Lang::ml(
                     'wallet.widget.history.des.journals.refund', 
                     { 'buyer' => $buyer->ljuser_display, 
-                      'entry_url' => ($prev_promo ? $prev_promo->object_url() : ''),
+                      'object_url' => ($prev_promo ? $prev_promo->object_url() : ''),
                       'journal' => $promo->slot->owner()->ljuser_display(),
                     }
                 );
@@ -122,7 +123,7 @@
                 return LJ::Lang::ml(
                     'wallet.widget.history.des.journals.income', 
                     { 'buyer' => $buyer->ljuser_display(),
-                      'entry_url' => $promo->object_url(),
+                      'object_url' => $promo->object_url(),
                     }
                 );
             } elsif ( $misc & LJ::Pay::Wallet::Log::MASK_REMAINDER() ) {
@@ -149,6 +150,23 @@
     }
 }
 
+sub get_cart_name {
+    my ($self, $cart_link) = @_;
+
+    my $prefix = $self->get_promo_class();
+    if ($prefix eq PROMO_JOURNAL()) {
+        my $promo = $self->get_promotion();
+        return LJ::Lang::ml('wallet.widget.history.des.order.journal', {
+            object_url  => $promo->object_url(),
+            journal     => $promo->slot->owner()->ljuser_display(),
+            'cart_link' => $cart_link,
+        });
+    }
+    return LJ::Lang::ml('wallet.widget.history.des.order', {
+            'cart_link' => $cart_link,
+    });
+}
+
 sub is_tangible {1}
 sub allow_repeat_cart {0}
 

Modified: trunk/cgi-bin/LJ/Widget/Shop/History.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/History.pm	2012-10-22 14:53:50 UTC (rev 12804)
+++ trunk/cgi-bin/LJ/Widget/Shop/History.pm	2012-10-22 15:01:43 UTC (rev 12805)
@@ -207,6 +207,8 @@
         }
 
         if ( $logitem->action eq ACTION_REMOVE ) {
+            my $cart_link = $cart->cart_link;
+
             if ( my $it = $it{'Tokens'} ) {
                 my $rcptid = $it->get_rcptid;
                 my $rcpt = LJ::load_userid($rcptid);
@@ -239,7 +241,6 @@
             if ( my $it = $it{'AppItem'} ) {
                 my $app = $it->get_app;
                 my $lj_app = ($app ? $app->ljapp_display : 'NO APPLICATION');
-                my $cart_link = $cart->cart_link;
                 return LJ::Lang::ml('wallet.widget.history.des.appitem', {
                     'lj_app' => $lj_app,
                     'app_url' => $app->href,
@@ -259,8 +260,10 @@
                 });
             }
 
+            if ( my $it = $it{'SelfPromo'} ) {
+                return $it->get_cart_name($cart_link);
+            }
 
-            my $cart_link = $cart->cart_link;
             return LJ::Lang::ml('wallet.widget.history.des.order', {
                 'cart_link' => $cart_link,
             });

Tags: dat, ljcom, pm, sunnyman, vtroitsky
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