madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20306: LJSUP-10119: Delayed entries is excluded...

Committer: sbelyaev
LJSUP-10119: Delayed entries is excluded from UI.
U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/Widget/EntryForm.pm
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2011-10-13 10:59:16 UTC (rev 20305)
+++ trunk/bin/upgrading/en.dat	2011-10-13 12:37:23 UTC (rev 20306)
@@ -1413,6 +1413,9 @@
 entryform.postto.select|staleness=1
 entryform.postto.select=Select a community
 
+entryform.post.edit|staleness=1
+entryform.post.edit=Edit date
+
 entryform.preview=Preview
 
 entryform.public|staleness=1

Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-10-13 10:59:16 UTC (rev 20305)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-10-13 12:37:23 UTC (rev 20306)
@@ -551,7 +551,8 @@
             </li>};
     }
 
-    $out .= qq{ <li class='pkg' id='modifydate' style='display: none;'><label class='title'>$BML::ML{'entryform.postponed.until'}</label>
+    my $postpone_edit_text = LJ::is_enabled("delayed_entries") ? $BML::ML{'entryform.postponed.until'} : $BML::ML{'entryform.post.edit'};
+    $out .= qq{ <li class='pkg' id='modifydate' style='display: none;'><label class='title'>$postpone_edit_text</label>
                 <span class='wrap'>
                     <input type="hidden" name="date_ymd_mm" value="$mon" />
                     <input type="hidden" name="date_ymd_dd" value="$mday" />
@@ -1614,24 +1615,28 @@
             my $u = LJ::load_user($login);
 
             my $can_manage = $remote->can_manage($u) || 0;
-            my $moderated = $u->prop('moderated');
-            my $need_moderated = ( $moderated =~ /^[1A]$/ ) ? 1 : 0;
-            my $can_post = ($u->{'journaltype'} eq 'C' && !$need_moderated) ||
+            if (LJ::is_enabled("delayed_entries")) {
+                my $moderated = $u->prop('moderated');
+                my $need_moderated = ( $moderated =~ /^[1A]$/ ) ? 1 : 0;
+                my $can_post = ($u->{'journaltype'} eq 'C' && !$need_moderated) ||
                             $can_manage;
    
-            my $ownerid = $u->userid;
-            my $posterid = $remote->userid;
+                my $ownerid = $u->userid;
+                my $posterid = $remote->userid;
 
-            # don't moderate admins, moderators & pre-approved users
-            my $dbh = LJ::get_db_writer();
-            my $relcount = $dbh->selectrow_array("SELECT COUNT(*) FROM reluser ".
+                # don't moderate admins, moderators & pre-approved users
+                my $dbh = LJ::get_db_writer();
+                my $relcount = $dbh->selectrow_array("SELECT COUNT(*) FROM reluser ".
                                                  "WHERE userid=$ownerid AND targetid=$posterid ".
                                                  "AND type IN ('A','M','N')");
         
+               $site_data->{$login}->{'can_post_delayed'} = (int $can_post) || !!$relcount;
+            } else {    
+                $site_data->{$login}->{'can_post_delayed'} = 1;
+            }
 
             $site_data->{$login}->{'is_replace_sticky'} = $u->has_sticky_entry;
             $site_data->{$login}->{'can_create_sticky'} = $can_manage;
-            $site_data->{$login}->{'can_post_delayed'} = (int $can_post) || !!$relcount;
         }
         $site->{remote_permissions} = $site_data;
     });

Tags: 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