forked from extern/egroupware
- Keep custom timespan start & end dates matching selected named range
- If all (or no end date) show until today, instead of a week
This commit is contained in:
parent
c14f25c0e8
commit
ec1f6e9068
@ -467,6 +467,7 @@ class timesheet_ui extends timesheet_bo
|
|||||||
$this->show_sums = false;
|
$this->show_sums = false;
|
||||||
if ($query_in['filter'])
|
if ($query_in['filter'])
|
||||||
{
|
{
|
||||||
|
$query_in['enddate'] = $query_in['enddate'] ? $query_in['enddate'] : time();
|
||||||
$date_filter = $this->date_filter($query_in['filter'],$query_in['startdate'],$query_in['enddate']);
|
$date_filter = $this->date_filter($query_in['filter'],$query_in['startdate'],$query_in['enddate']);
|
||||||
|
|
||||||
if ($query_in['startdate'])
|
if ($query_in['startdate'])
|
||||||
@ -652,6 +653,15 @@ class timesheet_ui extends timesheet_bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Update start / end dates for custom
|
||||||
|
if($query_in['filter'] != 'custom')
|
||||||
|
{
|
||||||
|
egw_json_response::get()->call(
|
||||||
|
'app.timesheet.update_timespan',
|
||||||
|
egw_time::to($query['startdate'] ? $query['startdate'] : now() ,egw_time::ET2),
|
||||||
|
$query['filter'] ? egw_time::to($query['enddate'], egw_time::ET2) : null
|
||||||
|
);
|
||||||
|
}
|
||||||
$total = parent::get_rows($query,$rows,$readonlys);
|
$total = parent::get_rows($query,$rows,$readonlys);
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
|
@ -81,6 +81,7 @@ app.classes.timesheet = AppJS.extend(
|
|||||||
jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus();
|
jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,6 +124,27 @@ app.classes.timesheet = AppJS.extend(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update custom filter timespan, without triggering a change
|
||||||
|
*/
|
||||||
|
update_timespan: function(start, end)
|
||||||
|
{
|
||||||
|
if(this && this.et2)
|
||||||
|
{
|
||||||
|
var nm = this.et2.getWidgetById('nm');
|
||||||
|
if(nm)
|
||||||
|
{
|
||||||
|
// Toggle update_in_progress to avoid another request
|
||||||
|
nm.update_in_progress = true;
|
||||||
|
this.et2.getWidgetById('startdate').set_value(start);
|
||||||
|
this.et2.getWidgetById('enddate').set_value(end);
|
||||||
|
nm.activeFilters.startdate = start;
|
||||||
|
nm.activeFilters.enddate = end;
|
||||||
|
nm.update_in_progress = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get title in order to set it as document title
|
* Get title in order to set it as document title
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<description value="Start"/>
|
<description value="Start"/>
|
||||||
<date id="startdate" onchange="widget.getParent().getWidgetById('enddate').set_min(widget.getValue());return true;"/>
|
<date id="startdate" onchange="widget.getParent().getWidgetById('enddate').set_min(widget.getValue());return true;"/>
|
||||||
<description value="End"/>
|
<description value="End"/>
|
||||||
<date statustext="Leave it empty for a full week" id="enddate" onchange="widget.getParent().getWidgetById('startdate').set_max(widget.getValue());return true;"/>
|
<date id="enddate" onchange="widget.getParent().getWidgetById('startdate').set_max(widget.getValue());return true;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</template>
|
</template>
|
||||||
<template id="timesheet.index.add" template="" lang="" group="0" version="1.7.001">
|
<template id="timesheet.index.add" template="" lang="" group="0" version="1.7.001">
|
||||||
|
Loading…
Reference in New Issue
Block a user