From 7aea534778fd26265c6f610b1b91f6159534cef5 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 12 Nov 2019 16:11:40 +0100 Subject: [PATCH] Added formatter to column Stunden: null values -> format to '0.0' Before the field was left empty. Now 0.0 will be displayed, even if FAS Stunden are left empty. --- .../views/lehre/lehrauftrag/acceptLehrauftragData.php | 2 +- .../views/lehre/lehrauftrag/approveLehrauftragData.php | 2 +- .../views/lehre/lehrauftrag/orderLehrauftragData.php | 2 +- public/js/lehre/lehrauftrag/acceptLehrauftrag.js | 6 +++++- public/js/lehre/lehrauftrag/approveLehrauftrag.js | 6 +++++- public/js/lehre/lehrauftrag/orderLehrauftrag.js | 6 +++++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index cc2f77f77..0999d7ae6 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -361,7 +361,7 @@ $filterWidgetArray = array( semester: {headerFilter:"input"}, lv_oe_kurzbz: {headerFilter:"input", width: "12%"}, gruppe: {headerFilter:"input", width: "5%"}, - stunden: {align:"right", + stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}, width: "5%"}, betrag: {align:"right", formatter: form_formatNulltoStringNumber, diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 7b432024c..616450a5c 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -382,7 +382,7 @@ $filterWidgetArray = array( lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, lektor: {headerFilter:"input"}, - stunden: {align:"right", + stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, betrag: {align:"right", formatter: form_formatNulltoStringNumber, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 754bbb0bb..2abf658e8 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -386,7 +386,7 @@ $filterWidgetArray = array( lv_oe_kurzbz: {headerFilter:"input"}, gruppe: {headerFilter:"input"}, lektor: {headerFilter:"input"}, - stunden: {align:"right", + stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1}, headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator, bottomCalc:"sum", bottomCalcParams:{precision:1}}, stundensatz: {visible: false}, diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index 06f4fd708..ea96a8c7c 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -38,8 +38,12 @@ var mut_formatStringDate = function(value, data, type, params, component) { // ----------------------------------------------------------------------------------------------------------------- // Formats null values to a string number '0.00' -var form_formatNulltoStringNumber = function(cell){ +var form_formatNulltoStringNumber = function(cell, formatterParams){ if (cell.getValue() == null){ + if (formatterParams.precision == 1) + { + return '0.0'; + } return '0.00'; } else { diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index 6d3c15bad..f07251882 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -38,8 +38,12 @@ var mut_formatStringDate = function(value, data, type, params, component) { // ----------------------------------------------------------------------------------------------------------------- // Formats null values to a string number '0.00' -var form_formatNulltoStringNumber = function(cell){ +var form_formatNulltoStringNumber = function(cell, formatterParams){ if (cell.getValue() == null){ + if (formatterParams.precision == 1) + { + return '0.0'; + } return '0.00'; } else { diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index a9b5bbdf6..8a7af5236 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -37,8 +37,12 @@ var mut_formatStringDate = function(value, data, type, params, component) { // ----------------------------------------------------------------------------------------------------------------- // Formats null values to a string number '0.00' -var form_formatNulltoStringNumber = function(cell){ +var form_formatNulltoStringNumber = function(cell, formatterParams){ if (cell.getValue() == null){ + if (formatterParams.precision == 1) + { + return '0.0'; + } return '0.00'; } else {