designtopack/public/site/models/project.php
isUnknown 4f60dc91d3 reorganize panel:
- project blueprints : add managers field
- projects blueprint : re organize, add 'Vos projets' section based on custom user method
- menu : hide dashboard item (useless)
2024-11-11 11:43:34 +01:00

48 lines
No EOL
1.2 KiB
PHP

<?php
class ProjectPage extends Page {
public function getSteps() {
$steps = [];
foreach ($this->children() as $child) {
$files = [];
if ($child->stepName() == 'clientBrief') {
foreach ($child->moodboard()->toFiles() as $file) {
$files[] = getFileData($file);
}
foreach ($child->pdf()->toFiles() as $file) {
$files[] = getFileData($file);
}
}
$steps[] = [
'text' => $child->title()->value(),
'value' => $child->stepName()->value(),
'index' => $child->stepIndex()->value(),
'modified' => $child->modified('Y-MM-dd'),
'uri' => $child->uri(),
'files' => $files
];
}
usort($steps, function ($a, $b) {
return $a['index'] <=> $b['index'];
});
return $steps;
}
public function getStepLabel() {
$stepsLabel = [
"clientBrief" => "brief",
"proposal" => "offre commerciale",
"extendedBrief" => "brief enrichi",
"industrialIdeation" => "idéation industrielle",
"virtualSample" => "échantillon virtuel",
"physicalSample" => "échantillon physique",
];
return $stepsLabel[$this->currentStep()->value()];
}
}