[livejournal] r20166: LJSUP-9815: custom_time proceeed added
Committer: sbelyaev
LJSUP-9815: custom_time proceeed addedU trunk/cgi-bin/LJ/Widget/EntryForm.pm U trunk/cgi-bin/ljprotocol.pl U trunk/htdocs/update.bml
Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm 2011-09-29 05:03:37 UTC (rev 20165)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm 2011-09-29 07:10:55 UTC (rev 20166)
@@ -411,6 +411,11 @@
value => 'guess',
id => 'journal_timezone',
});
+ $out .= LJ::html_hidden({
+ name => 'custom_time',
+ value => '0',
+ id => 'journal_time_edited',
+ });
$out .= "<script>try { \$('journal_timezone').value = - (new Date).getTimezoneOffset()/0.6; } catch(e) {} </script>";
$out .= "<div id='metainfo-wrap'><ul id='metainfo'>";
@@ -611,7 +616,6 @@
$out .= $self->render_userpics_block;
$out .= $self->render_infobox_block;
$out .= $self->render_metainfo_block;
-
return $out;
}
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl 2011-09-29 05:03:37 UTC (rev 20165)
+++ trunk/cgi-bin/ljprotocol.pl 2011-09-29 07:10:55 UTC (rev 20166)
@@ -2139,7 +2139,9 @@
}
if ( $req->{ver} > 1 ) {
- if ( LJ::DelayedEntry::is_future_date($req) ) {
+ my $use_delayed = $req->{'custom_time'} ||
+ !(exists $flags->{'use_custom_time'});
+ if ( $use_delayed && LJ::DelayedEntry::is_future_date($req) ) {
return fail($err, 215) unless $req->{tz};
# if posting to a moderated community, store and bail out here
Modified: trunk/htdocs/update.bml
===================================================================
--- trunk/htdocs/update.bml 2011-09-29 05:03:37 UTC (rev 20165)
+++ trunk/htdocs/update.bml 2011-09-29 07:10:55 UTC (rev 20166)
@@ -502,6 +502,7 @@
my $sticky = $POST{'sticky_type'} || $GET{'sticky_type'};
my $timezone = $POST{'timezone'} || $GET{'timezone'};
+ my $custom_time = $POST{'custom_time'} || $GET{'custom_time'};
$timezone = sprintf("%+.4d", $timezone);
my %req = (
'ver' => 2,
@@ -509,12 +510,13 @@
'password' => $POST{'password'},
'usejournal' => ($usejournalu) ? $usejournalu->user : undef,
'sticky' => $sticky,
+ 'custom_time' => $custom_time,
'tz' => $timezone,
'do_not_add_rss_friends' => $POST{'do_not_add_rss_friends'} ||
$GET{'do_not_add_rss_friends'}
);
- $flags->{'ignore_type'} = 1;
+ $flags->{'use_custom_time'} = 1;
LJ::entry_form_decode(\%req, \%POST);
if ($req{'event'} eq "") {
