Commit cb85be5c authored by Tibor Katelbach's avatar Tibor Katelbach

budget clear bug

parent 709cc3a1
......@@ -52,8 +52,10 @@ $actions = PHDB::find(Actions::COLLECTION, [
"parentType" => Form::ANSWER_COLLECTION] );
//clear any existing todos
foreach ($answers as $ix => $a) {
$answers[$ix]["todo"] = [];
if(isset($answers)){
foreach ($answers as $ix => $a) {
$answers[$ix]["todo"] = [];
}
}
//reset todo with actions
foreach ($actions as $id => $a) {
......@@ -74,11 +76,13 @@ foreach ($actions as $id => $a) {
}
}
//overload existing todo and add to answerObj
foreach ($answers as $ix => $a) {
if(empty($answers[$ix]["todo"]))
unset($answers[$ix]["todo"]);
else
echo "<script>answerObj.answers.".$copyF.".".$budgetKey."[".$ix."].todo = ".json_encode($answers[$ix]["todo"]).";</script>";
if(isset($answers)){
foreach ($answers as $ix => $a) {
if(empty($answers[$ix]["todo"]))
unset($answers[$ix]["todo"]);
else
echo "<script>answerObj.answers.".$copyF.".".$budgetKey."[".$ix."].todo = ".json_encode($answers[$ix]["todo"]).";</script>";
}
}
$editBtnL = "";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment