madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r21702: LJSV-2121: Properties for delayed entrie...

Committer: sbelyaev
LJSV-2121: Properties for delayed entries
U   trunk/bin/upgrading/proplists.dat
U   trunk/cgi-bin/LJ/DelayedEntry.pm
U   trunk/htdocs/admin/entryprops.bml
Modified: trunk/bin/upgrading/proplists.dat
===================================================================
--- trunk/bin/upgrading/proplists.dat	2012-04-12 07:57:15 UTC (rev 21701)
+++ trunk/bin/upgrading/proplists.dat	2012-04-12 08:46:02 UTC (rev 21702)
@@ -1812,3 +1812,16 @@
   des: userid of moderator, who approved this entry
   prettyname: Moderator's userid
   sortorder: 10
+
+logproplist.set_to_schedule:
+  datatype: num 
+  des: time when post set to schedule list
+  prettyname: Schedule time
+  sortorder: 112
+
+logproplist.revtime_sch:
+  datatype: num 
+  des: scheduled post last edit time
+  prettyname: Scheduled post last edit time
+  sortorder: 113
+

Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2012-04-12 07:57:15 UTC (rev 21701)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2012-04-12 08:46:02 UTC (rev 21702)
@@ -47,6 +47,12 @@
     my $journalid   = $journal->userid;
     my $posterid    = $poster->userid;
     my $subject     = $req->{subject};
+
+    my $now        = time;
+
+    $req->{props}->{'set_to_schedule'} = $now;
+    $req->{props}->{'revtime_sch'}     = $now;
+
     my $posttime    = __get_datetime($req);
     my $data_ser    = __serialize($req);
     my $delayedid   = LJ::alloc_user_counter( $journal,
@@ -128,6 +134,9 @@
     $req->{tz} = $req->{tz} || $self->data->{tz};
     $req->{ext}->{flags}->{u} = undef; # it's no need to be stored
 
+    $req->{props}->{'set_to_schedule'} = $self->prop('set_to_schedule');
+    $req->{props}->{'revtime_sch'} = time;
+
     my $journalid = $self->journal->userid;
     my $posterid  = $self->poster->userid;
     my $subject   = $req->{subject};

Modified: trunk/htdocs/admin/entryprops.bml
===================================================================
--- trunk/htdocs/admin/entryprops.bml	2012-04-12 07:57:15 UTC (rev 21701)
+++ trunk/htdocs/admin/entryprops.bml	2012-04-12 08:46:02 UTC (rev 21702)
@@ -75,6 +75,11 @@
 
     $ret .= "<ul>";
 
+    my %time_props = (
+        'revtime_sch' => 1,
+        'set_to_schedule' => 1,
+    );
+
     foreach my $prop (sort keys %props) {
         my $extra = "";
 
@@ -83,6 +88,9 @@
 
             # an ugly hack, i know
             $props{$prop} = LJ::TimeUtil->mysql_time($props{$prop}) if $p->{des} =~ /unix/i;
+            if ($time_props{$prop}) {
+                $props{$prop} = LJ::TimeUtil->mysql_time($props{$prop});
+            }
         }
         if ($prop eq 'moderator_id') {
             my $moderator = LJ::load_userid($props{$prop});

Tags: bml, dat, livejournal, madeon, pm, sbelyaev
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