Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -704,6 +704,8 @@ |
705 | 705 | * Create form for managing campaign settings (start date, end date, languages, etc.) |
706 | 706 | */ |
707 | 707 | function noticeDetailForm( $notice ) { |
| 708 | + global $wgRequest; |
| 709 | + |
708 | 710 | if ( $this->editable ) { |
709 | 711 | $readonly = array(); |
710 | 712 | } else { |
— | — | @@ -728,6 +730,20 @@ |
729 | 731 | ); |
730 | 732 | |
731 | 733 | if ( $row ) { |
| 734 | + |
| 735 | + // If there was an error, we'll need to restore the state of the start date and time select lists |
| 736 | + if ( $wgRequest->wasPosted() ) { |
| 737 | + $startArray = $wgRequest->getArray( 'start' ); |
| 738 | + $timestamp = $startArray['year'] . |
| 739 | + $startArray['month'] . |
| 740 | + $startArray['day'] . |
| 741 | + $startArray['hour'] . |
| 742 | + $startArray['min'] . '00' |
| 743 | + ; |
| 744 | + } else { |
| 745 | + $timestamp = $row->not_start; |
| 746 | + } |
| 747 | + |
732 | 748 | // Get all languages associated with the campaign |
733 | 749 | $noticeLanguages = $this->getNoticeLanguages( $notice ); |
734 | 750 | |
— | — | @@ -740,12 +756,12 @@ |
741 | 757 | // Start Date |
742 | 758 | $htmlOut .= Xml::openElement( 'tr' ); |
743 | 759 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-date' ) ); |
744 | | - $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $row->not_start ) ); |
| 760 | + $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'start', $timestamp ) ); |
745 | 761 | $htmlOut .= Xml::closeElement( 'tr' ); |
746 | 762 | // Start Time |
747 | 763 | $htmlOut .= Xml::openElement( 'tr' ); |
748 | 764 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-start-hour' ) . "(GMT)" ); |
749 | | - $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $row->not_start, "[$row->not_name]" ) ); |
| 765 | + $htmlOut .= Xml::tags( 'td', array(), $this->timeSelector( 'start', $timestamp ) ); |
750 | 766 | $htmlOut .= Xml::closeElement( 'tr' ); |
751 | 767 | // End Date |
752 | 768 | $htmlOut .= Xml::openElement( 'tr' ); |