Remove year view

This commit is contained in:
Nathan Gray 2015-11-04 15:12:58 +00:00
parent e0cfd00582
commit 547338d14c
2 changed files with 0 additions and 242 deletions

View File

@ -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"}',

View File

@ -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 .= '<div class="calendar_calTimeGrid" style="height: 162px;">'."\n";
$content .= "\t".'<div class="calDayColsNoGrip">'."\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".'<div class="calendar_calDayCol" style="left: '.
((($month - 1) % self::YEARVIEW_COLS) * (100 / self::YEARVIEW_COLS)).'%; width: '.
((100 / self::YEARVIEW_COLS) - 0).'%;";>'."\n";
// Year Header
$content .= "\t\t\t".'<div class="calendar_calDayColHeader '.($month % 2 == 0 ? "th" : "row_on").'"'.
' style="height: 20px; line-height: 20px; z-index: 0;" title="'.lang(adodb_date('F',strtotime("+1 week",$month_start))).' '.adodb_date('Y',strtotime("+1 week",$month_start)).'">'."\n";
if (($month) == 1)
{
$content .= '<span style="position: absolute; left: 0px;">';
$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 .= '</span>'."\n";
}
$content .= "\t\t\t\t".'<a href="'.$GLOBALS['egw']->link('/index.php',
array('menuaction'=>'calendar.calendar_uiviews.month',
'date'=>$this->year.($month < 10 ? '0' : '').$month.'01')).
'" title="'.lang('Monthview').'">'.lang(adodb_date('F',strtotime("+1 week",$month_start))).'</a>'."\n";
if ($month == self::YEARVIEW_COLS)
{
$content .= '<span style="position: absolute; right: 0px;">';
$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 .= '</span>'."\n";
}
$content .= "\t\t\t".'</div>'."\n";
$content .= "\t\t\t".'<div'.
' style="position: absolute; width: 100%; height: 16px;'.
' top: 24px;">'."\n";
$content .= "\t\t\t\t".'<div class="calendar_cal_year_legend"'.
' style="text-align: center; position: absolute; width: 11.5%; height: 16px; left: 0.5%;">'.lang('Wk').'</div>'."\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".'<div class="'.$style.'"'.
' style="text-align: center; position: absolute; width: 11.5%; height: 16px; left: '.((($i + 1) * 12.5) + 0.5).'%;">'.
lang(adodb_date('D',$day_date)).'</div>'."\n";
}
$content .= "\t\t\t".'</div>'."\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".'<div'.
' style="position: absolute; width: 100%; height: 16px;'.
' top: '.((($week_in_month + 1) * 20) + 2).'px;">'."\n";
$content .= "\t\t\t\t".'<div class="calendar_cal_year_legend"'.
' style="text-align: center;position: absolute; width: 11.5%; height: 16px; left: 0.5%;" '.
'title="'.lang('Wk').' '.$this->week_number($week_start).'/'.adodb_date('Y',$week_start).'">'."\n";
$content .= "\t\t\t\t\t".
'<a href="'.$GLOBALS['egw']->link('/index.php',
array('menuaction'=>'calendar.calendar_uiviews.week',
'date'=>$this->bo->date2string($week_start)));
$content .= '">'.$this->week_number($week_start)."</a>\n";
$content .= "\t\t\t\t".'</div>'."\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".'<!-- Day cell -->'."\n";
$content .= "\t\t\t\t".'<div class="'.$css_class.'"'.
' style="position: absolute; width: 11.5%; height: 16px;'.
' line-height: 16px; left: '.((($i + 1) * 12.5) + 0.5).'%;'.
' "';
if ($holidays)
{
$content .= ' title="'.$holidays.'"';
}
$content .= '>'.adodb_date('d',$day_date).'</div>'."\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.'<div class="calendar_plannerEvent'.($data['private'] ? 'Private' : '').
'" data-tooltip ="'.$tooltip .
'" style="position: absolute; left: '.$left.'%; width: '.$width.'%; height: '.
$row_height.'%; top: '.($n * $row_height).'%;'.
'background-color: '.$color.';" '.'" data-date ="'.$this->bo->date2string($event['start']).'|'.$data['popup'].'" '.
'>'."\n".$data['html'].$indent."</div>\n";
}
}
}
}
$week_start = strtotime("+1 week",$week_start);
$content .= "\t\t\t".'</div>'."\n";
}
$content .= "\t\t".'</div>'."\n";
if (($month) % self::YEARVIEW_COLS == 0)
{
$content .= "\t</div>\n";
$content .= "</div>\n";
}
}
if (!$home)
{
$this->do_header();
echo $content;
}
return $content;
}
/**
* Displays the monthview or a multiple week-view
*