-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Training] adds session cancellation (#2855)
* Session cancellation * pr review * PageListSection
- Loading branch information
Showing
34 changed files
with
738 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/plugin/cursus/Installation/DataFixtures/Template/TrainingSessionCanceledData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Claroline\CursusBundle\Installation\DataFixtures\Template; | ||
|
||
use Claroline\CoreBundle\Installation\DataFixtures\AbstractTemplateFixture; | ||
|
||
class TrainingSessionCanceledData extends AbstractTemplateFixture | ||
{ | ||
protected static function getTemplateType(): string | ||
{ | ||
return 'training_session_canceled'; | ||
} | ||
|
||
protected function getSystemTemplates(): array | ||
{ | ||
return [ | ||
'Claroline Connect' => [ | ||
'en' => [ | ||
'title' => 'Training session cancellation', | ||
'content' => $this->twig->render('@ClarolineCursus/template/training_session_canceled.en.pdf.twig'), | ||
], | ||
'fr' => [ | ||
'title' => 'Annulation de session de formation', | ||
'content' => $this->twig->render('@ClarolineCursus/template/training_session_canceled.fr.pdf.twig'), | ||
], | ||
], | ||
]; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/plugin/cursus/Installation/Migrations/Version20240912144131.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Claroline\CursusBundle\Installation\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated migration based on mapping information: modify it with caution. | ||
* | ||
* Generation date: 2024/09/12 02:41:32 | ||
*/ | ||
final class Version20240912144131 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql(' | ||
ALTER TABLE claro_cursusbundle_course_session | ||
ADD canceled_template_id INT DEFAULT NULL, | ||
ADD canceled TINYINT(1) NOT NULL, | ||
ADD cancel_reason LONGTEXT DEFAULT NULL | ||
'); | ||
$this->addSql(' | ||
ALTER TABLE claro_cursusbundle_course_session | ||
ADD CONSTRAINT FK_C5F56FDE4FDA7C5E FOREIGN KEY (canceled_template_id) | ||
REFERENCES claro_template (id) | ||
ON DELETE SET NULL | ||
'); | ||
$this->addSql(' | ||
CREATE INDEX IDX_C5F56FDE4FDA7C5E ON claro_cursusbundle_course_session (canceled_template_id) | ||
'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql(' | ||
ALTER TABLE claro_cursusbundle_course_session | ||
DROP FOREIGN KEY FK_C5F56FDE4FDA7C5E | ||
'); | ||
$this->addSql(' | ||
DROP INDEX IDX_C5F56FDE4FDA7C5E ON claro_cursusbundle_course_session | ||
'); | ||
$this->addSql(' | ||
ALTER TABLE claro_cursusbundle_course_session | ||
DROP canceled_template_id, | ||
DROP canceled, | ||
DROP cancel_reason | ||
'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.