mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Timesheet: Update quantity placeholder when duration changes
This commit is contained in:
parent
59ea901cf9
commit
250beda64e
@ -192,6 +192,21 @@ class TimesheetApp extends EgwApp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If editing a timesheet and no quantity is set, update the placeholder text when duration changes
|
||||||
|
*
|
||||||
|
* This is for display only
|
||||||
|
*/
|
||||||
|
update_quantity(event, widget)
|
||||||
|
{
|
||||||
|
const quantity = this.et2.getWidgetById("ts_quantity");
|
||||||
|
if(quantity)
|
||||||
|
{
|
||||||
|
// Duration is in minutes, round to hours with 1 decimal
|
||||||
|
quantity.placeholder = Math.round(parseInt(widget.value) / 6) / 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get title in order to set it as document title
|
* Get title in order to set it as document title
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
@ -137,12 +137,13 @@
|
|||||||
<et2-date-timeonly id="start_time"></et2-date-timeonly>
|
<et2-date-timeonly id="start_time"></et2-date-timeonly>
|
||||||
</row>
|
</row>
|
||||||
<row class="row dialogHeader3">
|
<row class="row dialogHeader3">
|
||||||
<et2-description value="Duration" for="ts_duration"></et2-description>
|
<et2-description value="Duration" for="ts_duration"></et2-description>
|
||||||
<et2-date-duration id="ts_duration" displayFormat="hm"></et2-date-duration>
|
<et2-date-duration id="ts_duration" displayFormat="hm"
|
||||||
<et2-description></et2-description>
|
onchange="app.timesheet.update_quantity"></et2-date-duration>
|
||||||
<et2-description value="or endtime" class="et2_noWrap"></et2-description>
|
<et2-description></et2-description>
|
||||||
<et2-date-timeonly id="end_time"></et2-date-timeonly>
|
<et2-description value="or endtime" class="et2_noWrap"></et2-description>
|
||||||
</row>
|
<et2-date-timeonly id="end_time"></et2-date-timeonly>
|
||||||
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<et2-tabbox id="tabs" class="et2_nowrap" width="100%" span="all" tabHeight="200">
|
<et2-tabbox id="tabs" class="et2_nowrap" width="100%" span="all" tabHeight="200">
|
||||||
<tabs>
|
<tabs>
|
||||||
|
Loading…
Reference in New Issue
Block a user