Fix on CSV export
added extra questions Change-Id: I3dbff98c7a3e11d5ee2a72a0cf90a51cb5d35a5a Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
parent
bdf83738c2
commit
e107db8ba2
|
@ -65,7 +65,14 @@ final class AdminPresentationCSVSerializer extends AdminPresentationSerializer
|
|||
$values['public_video'] = sprintf('=HYPERLINK("%s";"%s")', $media_upload_csv['public_url'], $media_upload_csv['filename']);
|
||||
}
|
||||
}
|
||||
// extra questions
|
||||
|
||||
$values['extra_questions'] = '';
|
||||
foreach ($presentation->getExtraQuestionAnswers() as $answer){
|
||||
if(!empty($values['extra_questions']))
|
||||
$values['extra_questions'] = $values['extra_questions'] . '|';
|
||||
$values['extra_questions'] = $values['extra_questions'] . (string)$answer;
|
||||
}
|
||||
return $values;
|
||||
}
|
||||
}
|
|
@ -91,4 +91,13 @@ abstract class ExtraQuestionAnswer extends SilverstripeBaseModel
|
|||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function __toString():string
|
||||
{
|
||||
$value = $this->value;
|
||||
if($this->question->allowsValues()){
|
||||
$value = $this->question->getNiceValue($value);
|
||||
}
|
||||
return sprintf("%s : %s", $this->question->getLabel(), $value);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue