журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[ljcom] r12837: LJSUP-14016: Console comand for journal ...

Committer: nnikulochkina
LJSUP-14016: Console comand for journal promo
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-10-29 09:15:08 UTC (rev 12836)
+++ trunk/bin/upgrading/en_LJ.dat	2012-10-29 09:35:25 UTC (rev 12837)
@@ -11371,6 +11371,48 @@
 http://www.livejournal.com
 .
 
+journals.notification.deactivate.ineligible.poster_banned.subject=Entry promotion discontinued
+journals.notification.deactivate.ineligible.poster_banned.body<<
+Dear [[user]]!
+
+Promotion of your entry at [[object_url]] in [[slot_journal]] journal Promo was discontinued because poster is banned from Journal Promo Service.
+
+Thank you for using the service!
+
+
+Best regards,
+LiveJournal Team
+http://www.livejournal.com
+.
+
+journals.notification.deactivate.ineligible.journal_banned.subject=Entry promotion discontinued
+journals.notification.deactivate.ineligible.journal_banned.body<<
+Dear [[user]]!
+
+Promotion of your entry at [[object_url]] in [[slot_journal]] journal Promo was discontinued because journal is banned from Journal Promo Service.
+
+Thank you for using the service!
+
+
+Best regards,
+LiveJournal Team
+http://www.livejournal.com
+.
+
+journals.notification.deactivate.ineligible.entry_banned.subject=Entry promotion discontinued
+journals.notification.deactivate.ineligible.entry_banned.body<<
+Dear [[user]]!
+
+Promotion of your entry at [[object_url]] in [[slot_journal]] journal Promo was discontinued because this entry is banned from Journal Promo Service.
+
+Thank you for using the service!
+
+
+Best regards,
+LiveJournal Team
+http://www.livejournal.com
+.
+
 journals.shop_item.type=Journal promo service
 
 sharing.service.vkontakte|staleness=1

Modified: trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm	2012-10-29 09:15:08 UTC (rev 12836)
+++ trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm	2012-10-29 09:35:25 UTC (rev 12837)
@@ -27,14 +27,14 @@
 
         'promo' =>
             'Promo type to perform cmd for. Default: no value that means it apply for all promos. ' .
-            'Available values: '.join(', ', PROMO_SELF(), PROMO_COMMERCIAL(), PROMO_NOTIFICATIONS()).'.',
+            'Available values: '.join(', ', PROMO_SELF(), PROMO_COMMERCIAL(), PROMO_NOTIFICATIONS(), PROMO_JOURNAL()).'.',
 
         'region' =>
             'For "cancel" only, an optional flag that specifies ' .
             'region of the promo. Available regions are: [' . 
             join(',', LJ::Pay::PromotionSlot->get_all_regions()) . ']. ' .
             'Default region: '. PROMO_REGION_DEFAULT(),
- 
+
         'norefund' =>
             'For "cancel" only, an optional flag that specifies ' .
             'not to issue token refund to the promotion author.',
@@ -116,7 +116,7 @@
     if (@args_remainder) {
         my ($arg) = @args_remainder;
 
-        if ($arg =~ /^(selfpromo|commercial|notifications)/) {
+        if ($arg =~ /^(selfpromo|commercial|notifications|journals)/) {
             $promo_class = $1;
             shift @args_remainder;
             $arg = $args_remainder[0];
@@ -143,14 +143,21 @@
 #warn "PROMO_CLASS: $promo_class";
 #warn "Reason: $reason";
 
-    my @promo_classes = $promo_class eq 'all' ? (PROMO_SELF(), PROMO_COMMERCIAL(), PROMO_NOTIFICATIONS() ) : ($promo_class);
+    my @promo_classes = $promo_class eq 'all' ? ( PROMO_SELF(), PROMO_COMMERCIAL(), PROMO_NOTIFICATIONS(), PROMO_JOURNAL() ) : ($promo_class);
 
     if ( $cmd eq 'cancel' ) {
+
+        if ( grep {PROMO_JOURNAL()} @promo_classes ){
+            $self->info("'cancel' command is not allowed for 'journals' promo class");
+        }
+
+
         #if ( $type =~ /^journal|community$/ ) {
         #    return $self->error('"cancel" requires personal journal or community') unless ($object->is_community || $object->is_personal);
         #    $type = $object->is_community ? 'community' : 'journal';
         #}
         foreach my $pc (@promo_classes) {
+            next if $pc eq PROMO_JOURNAL();
             my $slot = LJ::Pay::PromotionSlot->find_slot(class => $pc, type => $type, country => $country);
             $slot->check_current_promotion;
             my $current_promotion = $slot->current_promotion;
@@ -178,6 +185,7 @@
             my $u = $object->object;    # LJ::User
             # check all current promotions
             foreach my $pc (@promo_classes) {
+                next if $pc eq PROMO_JOURNAL();
                 foreach my $cc (LJ::Pay::PromotionSlot->get_all_regions($pc)) {
                     foreach my $ptype (LJ::Pay::PromotionSlot->get_all_types($pc, $cc)) {
                         my $slot = LJ::Pay::PromotionSlot->find_slot(class => $pc, type => $ptype, country => $cc);
@@ -201,6 +209,7 @@
         if ( $type eq PROMO_OBJECT_TYPE_ENTRY() ) {
             my $entry = $object->object;
             foreach my $pc (@promo_classes) {
+                next if $pc eq PROMO_JOURNAL();
                 foreach my $cc (LJ::Pay::PromotionSlot->get_all_regions($pc)) {
                     my $slot = LJ::Pay::PromotionSlot->find_slot(class => $pc, type => $type, country => $cc);
                     $slot->check_current_promotion;

Tags: dat, ljcom, nikulochkina, nnikulochkina, 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