This repository has been archived by the owner on Dec 27, 2023. It is now read-only.
/
WestPanel.js
101 lines (88 loc) · 3.37 KB
/
WestPanel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Tine 2.0
*
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
* @author Cornelius Weiss <c.weiss@metaways.de>
* @copyright Copyright (c) 2009-2010 Metaways Infosystems GmbH (http://www.metaways.de)
*/
Ext.ns('Tine.Calendar');
/**
* Calendar west panel
*
* @namespace Tine.Calendar
* @class Tine.Calendar.WestPanel
* @extends Tine.widgets.mainscreen.WestPanel
*
* @author Cornelius Weiss <c.weiss@metaways.de>
*
* @constructor
* @xtype tine.calendar.mainscreenwestpanel
*/
Tine.Calendar.WestPanel = Ext.extend(Tine.widgets.mainscreen.WestPanel, {
cls: 'cal-tree',
canonicalName: 'Event',
defaultCollapseContainerTree: true,
getAdditionalItems: function() {
return [
Ext.apply(this.getAttendeeFilter(), this.defaults),
Ext.apply({
title: this.app.i18n._('Mini Calendar'),
canonicalName: 'MiniDatePicker',
forceLayout: true,
border: false,
layout: 'hbox',
layoutConfig: {
align:'middle'
},
defaults: {border: false},
items: [{
flex: 1
}, this.getDatePicker(), {
flex: 1
}]
}, this.defaults)
];
},
getDatePicker: function() {
if (! this.datePicker) {
this.datePicker = new Ext.DatePicker({
width: 200,
id :'cal-mainscreen-minical',
plugins: [new Ext.ux.DatePickerWeekPlugin({
weekHeaderString: Tine.Tinebase.appMgr.get('Calendar').i18n._('WK'),
inspectMonthPickerClick: function(btn, e) {
if (e.getTarget('button')) {
var contentPanel = Tine.Tinebase.appMgr.get('Calendar').getMainScreen().getCenterPanel();
contentPanel.changeView('month', this.activeDate);
return false;
}
}
})],
selectToday: function() {
var contentPanel = Tine.Tinebase.appMgr.get('Calendar').getMainScreen().getCenterPanel(),
pagingBar = contentPanel.getCalendarPanel(contentPanel.activeView).getTopToolbar();
pagingBar.onClick('today');
this.update(new Date().clearTime());
},
listeners: {
scope: this,
select: function(picker, value, weekNumber) {
var contentPanel = Tine.Tinebase.appMgr.get('Calendar').getMainScreen().getCenterPanel();
contentPanel.changeView(weekNumber ? 'week' : 'day', value);
}
}
});
}
return this.datePicker;
},
getAttendeeFilter: function() {
if (! this.attendeeFilter) {
this.attendeeFilter = new Tine.Calendar.AttendeeFilterGrid({
canonicalName: 'AttendeeFilter',
autoHeight: true,
title: this.app.i18n._('Attendee')
});
}
return this.attendeeFilter;
}
});