|
13 | 13 | class ViewWeekSelect extends ViewWeekCalendar { |
14 | 14 | private $bug_id; |
15 | 15 |
|
16 | | - public function __construct( $p_week, $p_user, $p_is_full_time, $p_days_events, $p_bug_id ) { |
17 | | - parent::__construct( $p_week, $p_user, $p_is_full_time, $p_days_events, plugin_page( 'event_insert' ) . '&bug_id=' . $p_bug_id . htmlspecialchars( form_security_param( 'event_insert' ) ) ); |
| 16 | + public function __construct( $p_week, $p_user, $p_is_full_time, $p_days_events, $p_bug_id, $p_year ) { |
| 17 | + parent::__construct( $p_week, $p_user, $p_is_full_time, $p_days_events, plugin_page( 'event_insert' ) . '&bug_id=' . $p_bug_id . htmlspecialchars( form_security_param( 'event_insert' ) ), $p_year ); |
18 | 18 | $this->bug_id = (int)$p_bug_id; |
19 | 19 | } |
20 | 20 |
|
@@ -45,21 +45,21 @@ protected function print_menu_top() { |
45 | 45 |
|
46 | 46 | echo '<div class="btn-group pull-left">'; |
47 | 47 | if( WeekCalendar::$full_time_is == FALSE ) { |
48 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . $this->week . "&full_time=TRUE" . '&id=' . $this->bug_id, "0-24" ); |
| 48 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . $this->week . "&year=" . $this->year . "&full_time=TRUE" . '&id=' . $this->bug_id, "0-24" ); |
49 | 49 | } else { |
50 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . $this->week . '&id=' . $this->bug_id, gmdate( "H", plugin_config_get( 'time_day_start' ) ) . "-" . gmdate( "H", plugin_config_get( 'time_day_finish' ) ) ); |
| 50 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . $this->week . "&year=" . $this->year . '&id=' . $this->bug_id, gmdate( "H", plugin_config_get( 'time_day_start' ) ) . "-" . gmdate( "H", plugin_config_get( 'time_day_finish' ) ) ); |
51 | 51 | } |
52 | 52 | echo '</div>'; |
53 | 53 |
|
54 | 54 | echo '<div class="btn-group pull-right">'; |
55 | 55 | if( WeekCalendar::$full_time_is == FALSE ) { |
56 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . ($this->week - 1) . '&id=' . $this->bug_id, plugin_lang_get( 'previous_period' ) ); |
| 56 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . date( "W", timestamp_previous_week_get( $this->week, $this->year ) ) . "&year=" . date( "Y", timestamp_previous_week_get( $this->week, $this->year ) ) . '&id=' . $this->bug_id, plugin_lang_get( 'previous_period' ) ); |
57 | 57 | print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . (int)date( "W" ) . '&id=' . $this->bug_id, plugin_lang_get( 'week' ) ); |
58 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . ($this->week + 1) . '&id=' . $this->bug_id, plugin_lang_get( 'next_period' ) ); |
| 58 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . date( "W", timestamp_next_week_get( $this->week, $this->year ) ) . "&year=" . date( "Y", timestamp_next_week_get( $this->week, $this->year ) ) . '&id=' . $this->bug_id, plugin_lang_get( 'next_period' ) ); |
59 | 59 | } else { |
60 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . ($this->week - 1) . "&full_time=TRUE" . '&id=' . $this->bug_id, plugin_lang_get( 'previous_period' ) ); |
| 60 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . date( "W", timestamp_previous_week_get( $this->week, $this->year ) ) . "&year=" . date( "Y", timestamp_previous_week_get( $this->week, $this->year ) ) . "&full_time=TRUE" . '&id=' . $this->bug_id, plugin_lang_get( 'previous_period' ) ); |
61 | 61 | print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . (int)date( "W" ) . "&full_time=TRUE" . '&id=' . $this->bug_id, plugin_lang_get( 'week' ) ); |
62 | | - print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . ($this->week + 1) . "&full_time=TRUE" . '&id=' . $this->bug_id, plugin_lang_get( 'next_period' ) ); |
| 62 | + print_small_button( plugin_page( 'event_insert_page' ) . "&for_user=" . $this->for_user . "&week=" . date( "W", timestamp_next_week_get( $this->week, $this->year ) ) . "&year=" . date( "Y", timestamp_next_week_get( $this->week, $this->year ) ) . "&full_time=TRUE" . '&id=' . $this->bug_id, plugin_lang_get( 'next_period' ) ); |
63 | 63 | } |
64 | 64 | echo '</div>'; |
65 | 65 |
|
@@ -88,6 +88,7 @@ protected function print_menu_bottom() { |
88 | 88 | # CSRF protection not required here - form does not result in modifications |
89 | 89 | echo '<input type="hidden" name="page" value="Calendar/event_insert_page" />'; |
90 | 90 | echo '<input type="hidden" name="week" value="' . $this->week . '" />'; |
| 91 | + echo '<input type="hidden" name="year" value="' . $this->year . '" />'; |
91 | 92 | echo '<input type="hidden" name="full_time" value="' . (int)self::$full_time_is . '" />'; |
92 | 93 | echo '<input type="hidden" name="id" value="' . $this->bug_id . '" />'; |
93 | 94 |
|
|
0 commit comments