Merge pull request #5324 from christianbeeznest/GH-5314

Internal: Add extra fields for allow_scheduled_announcements - refs #5314
pull/5330/head
christianbeeznest 8 months ago committed by GitHub
commit 9bf12605b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      src/CoreBundle/DataFixtures/ExtraFieldFixtures.php
  2. 14
      src/CoreBundle/Migrations/Schema/V200/Version20230216122900.php

@ -248,6 +248,22 @@ class ExtraFieldFixtures extends Fixture
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'attachment',
'display_text' => 'Attachment',
'item_type' => ExtraField::SCHEDULED_ANNOUNCEMENT,
'value_type' => ExtraField::FIELD_TYPE_FILE,
'visible_to_self' => true,
'changeable' => true,
],
[
'variable' => 'send_to_coaches',
'display_text' => 'Send to Coaches',
'item_type' => ExtraField::SCHEDULED_ANNOUNCEMENT,
'value_type' => ExtraField::FIELD_TYPE_CHECKBOX,
'visible_to_self' => true,
'changeable' => true,
],
];
$options = [

@ -674,6 +674,20 @@ class Version20230216122900 extends AbstractMigrationChamilo
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (7, 7, 'end_date', 'EndDate', 1, 1, 1, NOW())"
);
}
$attachmentExists = $this->connection->fetchOne("SELECT COUNT(*) FROM extra_field WHERE variable = 'attachment' AND item_type = 13");
if ($attachmentExists == 0) {
$this->addSql(
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (13, 18, 'attachment', 'Attachment', 1, 1, 1, NOW())"
);
}
$sendToCoachesExists = $this->connection->fetchOne("SELECT COUNT(*) FROM extra_field WHERE variable = 'send_to_coaches' AND item_type = 13");
if ($sendToCoachesExists == 0) {
$this->addSql(
"INSERT INTO extra_field (item_type, value_type, variable, display_text, visible_to_self, changeable, filter, created_at) VALUES (13, 13, 'send_to_coaches', 'Send to Coaches', 1, 1, 1, NOW())"
);
}
}
public function down(Schema $schema): void

Loading…
Cancel
Save