X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=WEB-INF%2Ftemplates%2Fexpense_edit.tpl;h=850e6442abaa03c60b0edbefb1423c114e3093b2;hb=3c60698710dfd998fd1488c674b944f5df9b0dce;hp=bcd393a5a7b0672da17c7c7087e6fd7195f9477d;hpb=f270b1e143509303e32f65c3dda3fbecaee56c6b;p=timetracker.git diff --git a/WEB-INF/templates/expense_edit.tpl b/WEB-INF/templates/expense_edit.tpl index bcd393a5..850e6442 100644 --- a/WEB-INF/templates/expense_edit.tpl +++ b/WEB-INF/templates/expense_edit.tpl @@ -34,6 +34,18 @@ var defined_expenses = new Array(); idx++; {/foreach} +{* Conditional include of confirmSave handler. *} +{if $confirm_save} +var original_date = "{$entry_date}"; + +function confirmSave() { + var date_on_save = document.getElementById("date").value; + if (original_date != date_on_save) { + return confirm("{$i18n.warn.confirm_save}"); + } +} +{/if} + // The fillProjectDropdown function populates the project combo box with // projects associated with a selected client (client id is passed here as id). function fillProjectDropdown(id) { @@ -86,7 +98,7 @@ function recalculateCost() { var comment_control = document.getElementById("item_name"); var cost_control = document.getElementById("cost"); - var replaceDecimalMark = ("." != "{$user->decimal_mark}"); + var replaceDecimalMark = ("." != "{$user->getDecimalMark()}"); // Calculate cost. var dropdown = document.getElementById("predefined_expense"); @@ -102,10 +114,10 @@ function recalculateCost() { else { var expenseCost = defined_expenses[dropdown.selectedIndex - 1][2]; if (replaceDecimalMark) - expenseCost = expenseCost.replace("{$user->decimal_mark}", "."); + expenseCost = expenseCost.replace("{$user->getDecimalMark()}", "."); var newCost = (quantity_control.value * expenseCost).toFixed(2); if (replaceDecimalMark) - newCost = newCost.replace(".", "{$user->decimal_mark}"); + newCost = newCost.replace(".", "{$user->getDecimalMark()}"); cost_control.value = newCost; } } @@ -126,7 +138,7 @@ function recalculateCost() {