Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -514,7 +514,7 @@ |
515 | 515 | // If there was an error, we'll need to restore the state of the form |
516 | 516 | if ( $wgRequest->wasPosted() ) { |
517 | 517 | $startArray = $wgRequest->getArray( 'start' ); |
518 | | - $timestamp = $startArray['year'] . |
| 518 | + $startTimestamp = $startArray['year'] . |
519 | 519 | $startArray['month'] . |
520 | 520 | $startArray['day'] . |
521 | 521 | $startArray['hour'] . |
— | — | @@ -522,8 +522,8 @@ |
523 | 523 | ; |
524 | 524 | $projectSelected = $wgRequest->getVal( 'project_name' ); |
525 | 525 | $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
526 | | - } else { |
527 | | - $timestamp = null; |
| 526 | + } else { // Defaults |
| 527 | + $startTimestamp = null; |
528 | 528 | $projectSelected = ''; |
529 | 529 | $noticeLanguages = array(); |
530 | 530 | } |
— | — | @@ -547,12 +547,12 @@ |
548 | 548 | // Start Date |
549 | 549 | $htmlOut .= Xml::openElement( 'tr' ); |
550 | 550 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-date' ) ); |
551 | | - $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $timestamp ) ); |
| 551 | + $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $startTimestamp ) ); |
552 | 552 | $htmlOut .= Xml::closeElement( 'tr' ); |
553 | 553 | // Start Time |
554 | 554 | $htmlOut .= Xml::openElement( 'tr' ); |
555 | 555 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-hour' ) ); |
556 | | - $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $timestamp ) ); |
| 556 | + $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $startTimestamp ) ); |
557 | 557 | $htmlOut .= Xml::closeElement( 'tr' ); |
558 | 558 | // Project |
559 | 559 | $htmlOut .= Xml::openElement( 'tr' ); |
— | — | @@ -738,16 +738,22 @@ |
739 | 739 | // If there was an error, we'll need to restore the state of the form |
740 | 740 | if ( $wgRequest->wasPosted() ) { |
741 | 741 | $startArray = $wgRequest->getArray( 'start' ); |
742 | | - $timestamp = $startArray['year'] . |
| 742 | + $startTimestamp = $startArray['year'] . |
743 | 743 | $startArray['month'] . |
744 | 744 | $startArray['day'] . |
745 | 745 | $startArray['hour'] . |
746 | 746 | $startArray['min'] . '00' |
747 | 747 | ; |
| 748 | + $endArray = $wgRequest->getArray( 'end' ); |
| 749 | + $endTimestamp = $endArray['year'] . |
| 750 | + $endArray['month'] . |
| 751 | + $endArray['day'] . '000000' |
| 752 | + ; |
748 | 753 | $projectSelected = $wgRequest->getVal( 'project_name' ); |
749 | 754 | $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
750 | | - } else { |
751 | | - $timestamp = $row->not_start; |
| 755 | + } else { // Defaults |
| 756 | + $startTimestamp = $row->not_start; |
| 757 | + $endTimestamp = $row->not_end; |
752 | 758 | $projectSelected = $row->not_project; |
753 | 759 | $noticeLanguages = $this->getNoticeLanguages( $notice ); |
754 | 760 | } |
— | — | @@ -761,17 +767,17 @@ |
762 | 768 | // Start Date |
763 | 769 | $htmlOut .= Xml::openElement( 'tr' ); |
764 | 770 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-date' ) ); |
765 | | - $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $timestamp ) ); |
| 771 | + $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $startTimestamp ) ); |
766 | 772 | $htmlOut .= Xml::closeElement( 'tr' ); |
767 | 773 | // Start Time |
768 | 774 | $htmlOut .= Xml::openElement( 'tr' ); |
769 | 775 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-hour' ) . "(GMT)" ); |
770 | | - $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $timestamp ) ); |
| 776 | + $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $startTimestamp ) ); |
771 | 777 | $htmlOut .= Xml::closeElement( 'tr' ); |
772 | 778 | // End Date |
773 | 779 | $htmlOut .= Xml::openElement( 'tr' ); |
774 | 780 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-end-date' ) ); |
775 | | - $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'end', $row->not_end ) ); |
| 781 | + $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'end', $endTimestamp ) ); |
776 | 782 | $htmlOut .= Xml::closeElement( 'tr' ); |
777 | 783 | // Project |
778 | 784 | $htmlOut .= Xml::openElement( 'tr' ); |