Committer: vtroitsky
LJSUP-12403: Console commands with commercial promoU trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm 2012-08-16 12:42:47 UTC (rev 12481) +++ trunk/cgi-bin/LJ/Console/Command/SelfPromo.pm 2012-08-16 13:00:54 UTC (rev 12482) @@ -112,21 +112,26 @@ my $country = PROMO_REGION_DEFAULT(); my ($norefund, $reason) = 0; + if (@args_remainder) { my ($arg) = @args_remainder; + if ($arg =~ /^(selfpromo|commercial|notifications)/) { $promo_class = $1; shift @args_remainder; + $arg = $args_remainder[0]; } - if ( $arg =~ /^ua$/ ) { + if ( $arg =~ /^(cyr|ua|sg|my|th)$/ ) { $country = $arg; shift @args_remainder; + $arg = $args_remainder[0]; } if ( $arg eq 'norefund' ) { $norefund = 1; shift @args_remainder; + $arg = $args_remainder[0]; } $reason = join ' ', @args_remainder if @args_remainder; @@ -137,6 +142,7 @@ } #warn "PROMO_CLASS: $promo_class"; #warn "Reason: $reason"; + my @promo_classes = $promo_class eq 'all' ? (PROMO_SELF(), PROMO_COMMERCIAL(), PROMO_NOTIFICATIONS() ) : ($promo_class); if ( $cmd eq 'cancel' ) { @@ -161,9 +167,9 @@ } $self->_cancel_object( 'slot' => $slot, 'type' => $type, 'object' => $object, 'refund' => !$norefund, 'reason' => $reason ); + $self->info( "$object_orig cancelled successfully from $pc $country promo" ); } - $self->info( "$object_orig cancelled successfully from $promo_class $country promo" . ($promo_class eq 'all' ? 's' : '') . '.' ); return 1; }