From 547338d14c5c9729ddf1231238d70ff8a4b44d9d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 4 Nov 2015 15:12:58 +0000 Subject: [PATCH] Remove year view --- calendar/inc/class.calendar_ui.inc.php | 5 - calendar/inc/class.calendar_uiviews.inc.php | 237 -------------------- 2 files changed, 242 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index a2f4df8b01..08588700c6 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -696,11 +696,6 @@ class calendar_ui 'value' => '{"view":"month"}', 'selected' => $this->view == 'month', ), - array( - 'text' => lang('yearview'), - 'value' => '{"view":"year", "menuaction":"calendar.calendar_uiviews.index"}', - 'selected' => $this->view == 'year', - ), array( 'text' => lang('planner by category'), 'value' => '{"view":"planner", "sortby":"category"}', diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index a743044918..11c83a4004 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -32,7 +32,6 @@ class calendar_uiviews extends calendar_ui 'week' => True, 'weekN' => True, 'month' => True, - 'year' => True, 'planner' => True, 'index' => True, ); @@ -438,242 +437,6 @@ class calendar_uiviews extends calendar_ui return $this->month($num,$home); } - /** Month column width (usually 3 or 4) in year view */ - const YEARVIEW_COLS = 3; - - /** - * Displays a year view - * - * @param boolean $home = false if true return content suitable for home-page - */ - function &year($home=false) - { - if ($this->debug > 0) $this->bo->debug_message('uiviews::year date=%2',True,$this->date); - - - $this->_month_align_year($this->first,$this->last); - - $GLOBALS['egw_info']['flags']['app_header'] .= ': '.$this->year; - - $merge = $this->merge(); - if($merge) - { - egw::redirect_link('/index.php',array( - 'menuaction' => 'calendar.calendar_uiviews.index', - 'msg' => $merge, - )); - } - - $days =& $this->bo->search(array( - 'start' => $this->first, - 'end' => $this->last, - ) + $this->search_params); - - /* Loop through the week-aligned months. */ - for ($month = 1; $month <= 12; $month++) - { - // The first date entry in the view may be in the last month. - if (($month - 1) % self::YEARVIEW_COLS == 0) - { - $content .= '
'."\n"; - $content .= "\t".'
'."\n"; - } - - $month_start = $this->datetime->get_weekday_start($this->year,$month,1); - // Beginning of the last week in the month - $month_end = $this->datetime->get_weekday_start( - $this->year, - $month, - $this->datetime->days_in_month($month,$this->year)); - // End of the last week in month - $month_end = strtotime("+6 days",$month_end); - - $content .= "\t\t".'
'."\n"; - - // Year Header - $content .= "\t\t\t".'
'."\n"; - if (($month) == 1) - { - $content .= ''; - $content .= html::a_href(html::image('phpgwapi','first',lang('previous'),$options=' alt="<<"'),array( - 'menuaction' => $this->view_menuaction, - 'date' => date('Ymd',strtotime('-1 year',strtotime($this->date))), - 'view' => 'year' - )); - $content .= ''."\n"; - } - $content .= "\t\t\t\t".''.lang(adodb_date('F',strtotime("+1 week",$month_start))).''."\n"; - if ($month == self::YEARVIEW_COLS) - { - $content .= ''; - $content .= html::a_href(html::image('phpgwapi','last',lang('next'),$options=' alt=">>"'),array( - 'menuaction' => $this->view_menuaction, - 'date' => date('Ymd',strtotime('+1 year',strtotime($this->date))), - 'view' => 'year' - )); - $content .= ''."\n"; - } - $content .= "\t\t\t".'
'."\n"; - - $content .= "\t\t\t".''."\n"; - $content .= "\t\t\t\t".'
'.lang('Wk').'
'."\n"; - // Day Columns, Legend - for ($i = 0; $i <= 6; $i++) - { - $day_date = ($i ? strtotime("+$i days",$month_start) : $month_start); - if (adodb_date('w',$day_date) % 6 == 0) - { - $style = 'calendar_cal_year_legend_weekend'; - } - else - { - $style = 'calendar_cal_year_legend'; - } - - $content .= "\t\t\t\t".'
'. - lang(adodb_date('D',$day_date)).'
'."\n"; - } - $content .= "\t\t\t".'
'."\n"; - - // Week rows in month - $week_start = $month_start; - for ($week_in_month = 1; $week_in_month <= 6; $week_in_month ++) - { - $content .= "\t\t\t".''."\n"; - - $content .= "\t\t\t\t".'
'."\n"; - $content .= "\t\t\t\t\t". - ''.$this->week_number($week_start)."\n"; - $content .= "\t\t\t\t".'
'."\n"; - // Day columns in week row - for ($i = 0; $i <= 6; $i++) - { - $day_date = $i ? strtotime("+$i days",$week_start) : $week_start; - $day_ymd = $this->bo->date2string($day_date); - $eventcount = count($days[$day_ymd]); - $in_month = true; - $css_class = ""; - $this->_day_class_holiday($day_ymd,$class,$holidays,false,false); - if (adodb_date('n',$day_date) != $month) - { - $css_class .= 'calendar_cal_year_legend'; - $in_month = false; - } - else - { - $css_class .= 'calendar_calEvent calendar_calEventAllAccepted'; - if (adodb_date('w',$day_date) % 6 == 0) - { - $css_class .= ' calendar_cal_year_weekend'; - } - else - { - if ($holidays) - { - $css_class .= ' calendar_calHoliday'; - } - else - { - $css_class .= ' calendar_cal_year_legend'; - } - } - - if ($day_ymd == $this->bo->date2string($this->bo->now_su)) - { - $css_class .= ' calendar_cal_year_today'; - } - } - $content .= "\t\t\t\t".''."\n"; - $content .= "\t\t\t\t".'
'."\n"; - - - if (($in_month) && (count($days[$day_ymd]))) - { - $eventCols = $this->getEventCols($day_ymd,$days[$day_ymd]); - // displaying all event columns of the day - $row_height = 100 / count($eventCols); - $space_left = 4; //% - $space_right = 1; //% - $row_width = 11.5 - $space_left - $space_right; - // settings for time2pos - $this->scroll_to_wdstart = false; - $this->wd_start = 0; - $this->wd_end = 24*60; - $this->granularity_m = 24 * 60; - $this->extraRows = -1; - $this->remBotExtraRows = 0; - $this->rowHeight = $row_width; - foreach($eventCols as $n => $eventCol) - { - foreach ($eventCol as $event) - { - $indent = "\t\t\t\t"; - // some fields set by the dayColWidget for the other views - unset($event['whole_day_on_top']); - $data = $this->eventWidget($event,25,$indent,$this->owner,true,'planner_event'); - - $left = ((($i + 1) * 12.5) + 0.5 + $space_left + $this->time2pos($event['start_m'])); - $width = $this->time2pos($event['end_m'] - $event['start_m']); - $color = $data['color'] ? $data['color'] : 'gray'; - - $tooltip = html::htmlspecialchars($data['tooltip']); - $content .= $indent.'
'."\n".$data['html'].$indent."
\n"; - } - } - } - } - $week_start = strtotime("+1 week",$week_start); - $content .= "\t\t\t".'
'."\n"; - } - $content .= "\t\t".'
'."\n"; - - if (($month) % self::YEARVIEW_COLS == 0) - { - $content .= "\t
\n"; - $content .= "\n"; - } - } - - if (!$home) - { - $this->do_header(); - - echo $content; - } - - return $content; - } - /** * Displays the monthview or a multiple week-view *