Commit 767883f4 authored by Frank Bergmann's avatar Frank Bergmann

- WIP

parent 40709ffe
...@@ -127,6 +127,32 @@ function launchTreePanel(){ ...@@ -127,6 +127,32 @@ function launchTreePanel(){
tooltip: '<%= [lang::message::lookup "" intranet-timesheet2-interval.Delete_logging "Delete entry"] %>', tooltip: '<%= [lang::message::lookup "" intranet-timesheet2-interval.Delete_logging "Delete entry"] %>',
id: 'buttonDeleteLogging', id: 'buttonDeleteLogging',
disabled: true disabled: true
}, '-', {
icon: '/intranet/images/navbar_default/arrow_left.png',
id: 'buttonCalendarArrowLeft',
handler: function() {
// move one day backward
var dateField = Ext.getCmp('datePicker');
var d = dateField.getValue();
d.setDate(d.getDate() - 1);
dateField.setValue(d);
}
}, {
xtype: 'datefield',
id: 'datePicker',
name: 'from_date',
value: new Date(),
maxValue: new Date() // limited to the current date or prior
}, '', {
icon: '/intranet/images/navbar_default/arrow_right.png',
id: 'buttonCalendarArrowRight',
handler: function() {
// move one day forward
var dateField = Ext.getCmp('datePicker');
var d = dateField.getValue();
d.setDate(d.getDate() + 1);
dateField.setValue(d);
}
}] }]
}); });
...@@ -174,6 +200,7 @@ function launchTreePanel(){ ...@@ -174,6 +200,7 @@ function launchTreePanel(){
'#buttonStopLogging': { click: this.onButtonStopLogging }, '#buttonStopLogging': { click: this.onButtonStopLogging },
'#buttonCancelLogging': { click: this.onButtonCancelLogging }, '#buttonCancelLogging': { click: this.onButtonCancelLogging },
'#buttonDeleteLogging': { click: this.onButtonDeleteLogging }, '#buttonDeleteLogging': { click: this.onButtonDeleteLogging },
'#datePicker': { change: this.onDatePickerChange },
scope: me.ganttTreePanel scope: me.ganttTreePanel
}); });
...@@ -186,7 +213,6 @@ function launchTreePanel(){ ...@@ -186,7 +213,6 @@ function launchTreePanel(){
// Listen to changes in the selction model in order to enable/disable the start/stop buttons // Listen to changes in the selction model in order to enable/disable the start/stop buttons
me.hourIntervalGrid.on('selectionchange', this.onGridSelectionChange, me); me.hourIntervalGrid.on('selectionchange', this.onGridSelectionChange, me);
// Catch a global key strokes. This is used to abort entry with Esc. // Catch a global key strokes. This is used to abort entry with Esc.
// For some reaons this doesn't work on the level of the HourButtonPanel, so we go for the global "window" // For some reaons this doesn't work on the level of the HourButtonPanel, so we go for the global "window"
Ext.EventManager.on(window, 'keydown', this.onWindowKeyDown, me); Ext.EventManager.on(window, 'keydown', this.onWindowKeyDown, me);
...@@ -194,6 +220,12 @@ function launchTreePanel(){ ...@@ -194,6 +220,12 @@ function launchTreePanel(){
return this; return this;
}, },
// The user chose a different date
onDatePickerChange: function() {
console.log('GanttButtonController.onDatePickerChange');
},
// Esc (Escape) button pressed somewhere in the application window // Esc (Escape) button pressed somewhere in the application window
onWindowKeyDown: function(e) { onWindowKeyDown: function(e) {
var keyCode = e.getKey(); var keyCode = e.getKey();
...@@ -327,7 +359,13 @@ function launchTreePanel(){ ...@@ -327,7 +359,13 @@ function launchTreePanel(){
// load the list of hourIntervals into the hourIntervalGrid // load the list of hourIntervals into the hourIntervalGrid
var projectId = record.get('id'); var projectId = record.get('id');
hourIntervalStore.getProxy().extraParams = { project_id: projectId, user_id: @current_user_id@, format: 'json' }; var date = Ext.getCmp('datePicker').getValue();
hourIntervalStore.getProxy().extraParams = {
project_id: projectId,
user_id: @current_user_id@,
format: 'json'
};
hourIntervalStore.load({ hourIntervalStore.load({
callback: function() { callback: function() {
console.log('PO.store.timesheet.HourIntervalStore: loaded'); console.log('PO.store.timesheet.HourIntervalStore: loaded');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment