mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
- Better granularity calculations using number of weeks & view
- Clicking sidebox calendar no longer changes view - Fixed header links to different day (broken in some views) & got clickable week numbers working
This commit is contained in:
parent
31a23f0dbd
commit
ed6948a9f2
@ -2458,8 +2458,13 @@ app.classes.calendar = AppJS.extend(
|
||||
{
|
||||
return state.days ? parseInt(state.days) === 7 : parseInt(egw.preference('days_in_weekview','calendar')) == 7;
|
||||
},
|
||||
/**
|
||||
* How big or small are the displayed time chunks?
|
||||
* We automatically scale the user's preference based on how many rows / calendars are shown.
|
||||
*/
|
||||
granularity: function(state) {
|
||||
return parseInt(egw.preference('interval','calendar')) || 30;
|
||||
return Math.min(240,(state.owner.length <= (egw.config('calview_no_consolidate','phpgwapi') || 5) ? state.owner.length : 1)
|
||||
* (parseInt(egw.preference('interval','calendar')) || 30));
|
||||
},
|
||||
extend: function(sub)
|
||||
{
|
||||
@ -2609,7 +2614,7 @@ jQuery.extend(app.classes.calendar,{
|
||||
return d;
|
||||
},
|
||||
granularity: function(state) {
|
||||
return (state.owner.length || 1) * app.calendar.View.granularity.call(this, state);
|
||||
return (parseInt(egw.preference('multiple_weeks','calendar')) || 3) * app.calendar.View.granularity.call(this, state);
|
||||
}
|
||||
}),
|
||||
month: app.classes.calendar.prototype.View.extend({
|
||||
|
@ -491,6 +491,9 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
||||
this.gridHeader
|
||||
.css('height', rowHeight+'%')
|
||||
.text(this.options.label)
|
||||
.attr('data-date', this.options.start_date)
|
||||
.attr('data-owner', this.options.owner)
|
||||
.append(this.owner.getDOMNode())
|
||||
.appendTo(this.div);
|
||||
|
||||
// the hour rows
|
||||
@ -1035,7 +1038,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
||||
var old = this.options.owner || 0;
|
||||
this.owner.set_label('');
|
||||
this.div.removeClass('calendar_TimeGridNoLabel');
|
||||
|
||||
|
||||
if(typeof _owner == 'string' && isNaN(_owner))
|
||||
{
|
||||
switch(_owner[0])
|
||||
@ -1062,6 +1065,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
||||
{
|
||||
this.owner.options.application = 'home-accounts'
|
||||
this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner));
|
||||
$j(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
|
||||
}
|
||||
|
||||
this.options.owner = _owner;//this.owner.getValue();
|
||||
@ -1220,6 +1224,10 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else if (this.gridHeader.is(_ev.target) && _ev.target.dataset)
|
||||
{
|
||||
app.calendar.update_state(jQuery.extend({view: 'week'},_ev.target.dataset));
|
||||
}
|
||||
else if (_ev.target.dataset.date)
|
||||
{
|
||||
// Default handler to open a new event at the selected time
|
||||
|
@ -230,7 +230,9 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
border-right: 1px solid silver;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
z-index: 30;
|
||||
}
|
||||
.calendar_calDayColHeader {
|
||||
z-index:30;
|
||||
}
|
||||
.calendar_calDayColHeader img {
|
||||
vertical-align: middle;
|
||||
@ -292,6 +294,16 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
.calendar_calGridHeader{
|
||||
text-align: left;
|
||||
padding-left: 3px;
|
||||
z-index: 29;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable {
|
||||
cursor: default;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable .calendar_calGridHeader {
|
||||
cursor: ns-resize;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable-disabled .calendar_calGridHeader {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* contains (multiple) events's
|
||||
|
@ -14,7 +14,6 @@ Egroupware
|
||||
<overlay>
|
||||
<template id="calendar.sidebox">
|
||||
<vbox parent_node="calendar-et2_target">
|
||||
<description label="eTemplate"/>
|
||||
<grid id="buttons" width="100%">
|
||||
<columns>
|
||||
<column/>
|
||||
@ -27,7 +26,7 @@ Egroupware
|
||||
</columns>
|
||||
<rows><row width="100%">
|
||||
<buttononly align="center" class="sideboxstar" id="add" onclick="egw.open(null,'calendar','add');" image="new" label="Add"/>
|
||||
<buttononly align="center" class="sideboxstar" id="day" image="today" label="Today" onclick="var formatDate = new Date(); app.calendar.update_state({view:'day',date:new Date(formatDate.valueOf() - formatDate.getTimezoneOffset() * 60 * 1000)});"/>
|
||||
<buttononly align="center" class="sideboxstar" id="day" image="today" label="Today" onclick="app.calendar.update_state({view:'day'});"/>
|
||||
<buttononly align="center" class="sideboxstar" id="week" image="week" label="Weekview" onclick="app.calendar.update_state({view:'week'});"/>
|
||||
<buttononly align="center" class="sideboxstar" id="weekN" image="multiweek" label="Multiple week view" onclick="app.calendar.update_state({view:'weekN'});"/>
|
||||
<buttononly align="center" class="sideboxstar" id="month" image="month" label="Month view" onclick="app.calendar.update_state({view:'month'});"/>
|
||||
@ -38,7 +37,7 @@ Egroupware
|
||||
</grid>
|
||||
<select id="view" class="et2_fullWidth" onchange="app.calendar.update_state(JSON.parse(widget.getValue()));"/>
|
||||
<textbox id="keywords" class="et2_fullWidth" blur="Search" onchange="app.calendar.update_state({keywords: widget.getValue()});"/>
|
||||
<date id="date" class="et2_fullWidth" inline="true" onchange="app.calendar.update_state({date:widget.getValue(),view:'day'});"/>
|
||||
<date id="date" class="et2_fullWidth" inline="true" onchange="app.calendar.update_state({date:widget.getValue()});"/>
|
||||
<textbox type="hidden" id="first"/>
|
||||
<textbox type="hidden" id="last"/>
|
||||
<hbox width="100%">
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @package calendar
|
||||
* @version $Id$
|
||||
*/
|
||||
/* $Id: app.css 53459 2015-08-24 17:28:19Z nathangray $ */
|
||||
/* $Id: app.css 53462 2015-08-25 00:00:45Z nathangray $ */
|
||||
/*Media print classes*/
|
||||
@media print {
|
||||
.th td,
|
||||
@ -242,6 +242,8 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
border-right: 1px solid silver;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.calendar_calDayColHeader {
|
||||
z-index: 30;
|
||||
}
|
||||
.calendar_calDayColHeader img {
|
||||
@ -304,6 +306,16 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
.calendar_calGridHeader {
|
||||
text-align: left;
|
||||
padding-left: 3px;
|
||||
z-index: 29;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable {
|
||||
cursor: default;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable .calendar_calGridHeader {
|
||||
cursor: ns-resize;
|
||||
}
|
||||
#calendar-view_view tbody.ui-sortable-disabled .calendar_calGridHeader {
|
||||
cursor: pointer;
|
||||
}
|
||||
/* contains (multiple) events's
|
||||
*/
|
||||
@ -1518,7 +1530,6 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
border-right: 1px solid silver;
|
||||
height: 16px;
|
||||
line-height: 12px;
|
||||
z-index: 30;
|
||||
}
|
||||
.calendar_calDayColHeader a img,
|
||||
.calendar_calGridHeader a img {
|
||||
|
@ -860,7 +860,6 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
|
||||
border-right: 1px solid silver;
|
||||
.dimension_height_s;
|
||||
line-height: 12px;
|
||||
z-index: 30;
|
||||
|
||||
a {
|
||||
img {
|
||||
|
Loading…
Reference in New Issue
Block a user