Merge pull request #52 from spekulatius/no-completed-for-current

MINOR: fixing completed class for current step
This commit is contained in:
Damian Mooyman 2015-12-03 09:52:07 +13:00
commit c99711da5d

View File

@ -594,12 +594,15 @@ abstract class MultiForm extends Form {
$firstStep = DataObject::get_one(static::$start_step, "\"SessionID\" = {$this->session->ID}"); $firstStep = DataObject::get_one(static::$start_step, "\"SessionID\" = {$this->session->ID}");
$firstStep->LinkingMode = ($firstStep->ID == $this->getCurrentStep()->ID) ? 'current' : 'link'; $firstStep->LinkingMode = ($firstStep->ID == $this->getCurrentStep()->ID) ? 'current' : 'link';
$firstStep->addExtraClass('completed');
$firstStep->setForm($this); $firstStep->setForm($this);
$stepsFound->push($firstStep); $stepsFound->push($firstStep);
// mark the further steps as non-completed if the first step is the current // 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); $this->getAllStepsRecursive($firstStep, $stepsFound);