From 1b84a832aa0f9a850077d1799c395fc0b9e3a624 Mon Sep 17 00:00:00 2001 From: Peter Thaleikis Date: Mon, 30 Nov 2015 21:27:37 +1300 Subject: [PATCH 1/2] MINOR: fixing completed class for current step --- code/model/MultiForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/model/MultiForm.php b/code/model/MultiForm.php index 4e0eb65..e0d5096 100644 --- a/code/model/MultiForm.php +++ b/code/model/MultiForm.php @@ -574,12 +574,15 @@ abstract class MultiForm extends Form { $firstStep = DataObject::get_one(static::$start_step, "\"SessionID\" = {$this->session->ID}"); $firstStep->LinkingMode = ($firstStep->ID == $this->getCurrentStep()->ID) ? 'current' : 'link'; - $firstStep->addExtraClass('completed'); $firstStep->setForm($this); $stepsFound->push($firstStep); // mark the further steps as non-completed if the first step is the current - if ($firstStep->ID == $this->getCurrentStep()->ID) $this->currentStepHasBeenFound = true; + if ($firstStep->ID == $this->getCurrentStep()->ID) { + $this->currentStepHasBeenFound = true; + } else { + $firstStep->addExtraClass('completed'); + } $this->getAllStepsRecursive($firstStep, $stepsFound); From 613bd6ab5d7b88452cbbc113cc49a0b8c7a07ced Mon Sep 17 00:00:00 2001 From: Peter Thaleikis Date: Mon, 30 Nov 2015 21:27:37 +1300 Subject: [PATCH 2/2] MINOR: fixing completed class for current step --- code/model/MultiForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/model/MultiForm.php b/code/model/MultiForm.php index 7bd0d00..b3ee72b 100644 --- a/code/model/MultiForm.php +++ b/code/model/MultiForm.php @@ -594,12 +594,15 @@ abstract class MultiForm extends Form { $firstStep = DataObject::get_one(static::$start_step, "\"SessionID\" = {$this->session->ID}"); $firstStep->LinkingMode = ($firstStep->ID == $this->getCurrentStep()->ID) ? 'current' : 'link'; - $firstStep->addExtraClass('completed'); $firstStep->setForm($this); $stepsFound->push($firstStep); // mark the further steps as non-completed if the first step is the current - if ($firstStep->ID == $this->getCurrentStep()->ID) $this->currentStepHasBeenFound = true; + if ($firstStep->ID == $this->getCurrentStep()->ID) { + $this->currentStepHasBeenFound = true; + } else { + $firstStep->addExtraClass('completed'); + } $this->getAllStepsRecursive($firstStep, $stepsFound);