Skip to content

Commit

Permalink
Add recalculation Button
Browse files Browse the repository at this point in the history
and calculation if the times change
  • Loading branch information
Sunnyka98 committed Jun 9, 2023
1 parent a4600b5 commit f8990db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion VerbrauchInKategorie/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
]
}
],
"actions": [],
"actions": [
{
"type":"Button",
"onClick": "Vik_CalculateConsumption($id);",
"caption": "Recalculate"
}
],
"status": [
{
"code": 200,
Expand Down
3 changes: 2 additions & 1 deletion VerbrauchInKategorie/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"A category is missing": "Eine Kategorie fehlt",
"A variable is invalid": "Eine Variable ist nicht valide",
"Minutes": "Minuten",
"The start time ist greater then the end time": "Die Startzeit ist größer als die Endzeit"
"The start time ist greater then the end time": "Die Startzeit ist größer als die Endzeit",
"Recalculate": "Neu berechnen"
}
}
}
1 change: 1 addition & 0 deletions VerbrauchInKategorie/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function RequestAction($Ident, $Value)
case 'StartTime':
case 'EndTime':
$this->SetValue($Ident, $Value);
$this->CalculateConsumption();
break;
default:
$this->SendDebug($Ident, 'You try to set an automatic variable', 0);
Expand Down

0 comments on commit f8990db

Please sign in to comment.