X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Ftemplates%2Fmobile%2Fexpense_edit.tpl;h=708cc23c4cadf9240b6be12bbb80a78619cf2687;hb=784c0088fb7f9892fdaf22374cd9ef98144afe12;hp=ea29723810366b6d1e9297f71a84d1cee3d77122;hpb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;p=timetracker.git diff --git a/WEB-INF/templates/mobile/expense_edit.tpl b/WEB-INF/templates/mobile/expense_edit.tpl index ea297238..708cc23c 100644 --- a/WEB-INF/templates/mobile/expense_edit.tpl +++ b/WEB-INF/templates/mobile/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() {