Minor: Format code

pull/5269/head
Angel Fernando Quiroz Campos 8 months ago
parent 43b2c90697
commit 1b615b3db6
  1. 2
      src/CoreBundle/EventListener/ExceptionListener.php
  2. 2
      src/CoreBundle/Migrations/AbstractMigrationChamilo.php
  3. 4
      src/CoreBundle/Migrations/Schema/V200/Version20211005153900.php
  4. 2
      src/CoreBundle/Migrations/Schema/V200/Version20230904173400.php
  5. 20
      src/CoreBundle/Migrations/Schema/V200/Version20230904173401.php

@ -6,7 +6,6 @@ declare(strict_types=1);
namespace Chamilo\CoreBundle\EventListener;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Exception\NotAllowedException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
@ -46,6 +45,7 @@ class ExceptionListener
$loginUrl = $this->router->generate('login', ['redirect' => $redirectUrl], UrlGeneratorInterface::ABSOLUTE_URL);
$event->setResponse(new RedirectResponse($loginUrl));
return;
}
}

@ -266,7 +266,7 @@ abstract class AbstractMigrationChamilo extends AbstractMigration implements Con
$groupId = $item['to_group_id'] ?? 0;
if (empty($item['lastedit_date'])) {
$lastUpdatedAt = new DateTime('now', new DateTimeZone('UTC'));
} else {
} else {
$lastUpdatedAt = new DateTime($item['lastedit_date'], new DateTimeZone('UTC'));
}
$newVisibility = ResourceLink::VISIBILITY_DRAFT;

@ -47,11 +47,11 @@ class Version20211005153900 extends AbstractMigrationChamilo
}
if (!$table->hasColumn('exercise_id')) {
$this->addSql("ALTER TABLE ticket_ticket ADD exercise_id INT DEFAULT NULL");
$this->addSql('ALTER TABLE ticket_ticket ADD exercise_id INT DEFAULT NULL');
}
if (!$table->hasColumn('lp_id')) {
$this->addSql("ALTER TABLE ticket_ticket ADD lp_id INT DEFAULT NULL");
$this->addSql('ALTER TABLE ticket_ticket ADD lp_id INT DEFAULT NULL');
}
$table = $schema->getTable('ticket_assigned_log');

@ -78,7 +78,7 @@ class Version20230904173400 extends AbstractMigrationChamilo
$subscriptionsInfo = $this->getSubscriptions((int) $personalAgenda['id']);
if (\count($subscriptionsInfo) > 0
&& $personalAgenda['subscription_visibility'] !== 0
&& 0 !== $personalAgenda['subscription_visibility']
) {
$invitationsOrSubscriptionsInfo = $subscriptionsInfo;
}

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
@ -12,23 +16,19 @@ class Version20230904173401 extends AbstractMigrationChamilo
return 'Calendar: Cleanup about invitations/subscriptions';
}
/**
* @inheritDoc
*/
public function up(Schema $schema): void
{
if ($schema->hasTable('agenda_event_invitation')) {
$this->addSql('ALTER TABLE personal_agenda DROP FOREIGN KEY FK_D8612460AF68C6B');
$this->addSql("DROP INDEX UNIQ_D8612460AF68C6B ON personal_agenda");
$this->addSql('DROP INDEX UNIQ_D8612460AF68C6B ON personal_agenda');
$this->addSql("ALTER TABLE personal_agenda DROP agenda_event_invitation_id, DROP collective, DROP subscription_visibility, DROP subscription_item_id");
$this->addSql('ALTER TABLE personal_agenda DROP agenda_event_invitation_id, DROP collective, DROP subscription_visibility, DROP subscription_item_id');
$this->addSql("ALTER TABLE agenda_event_invitation DROP FOREIGN KEY FK_52A2D5E161220EA6");
$this->addSql("DROP TABLE agenda_event_invitation");
$this->addSql('ALTER TABLE agenda_event_invitation DROP FOREIGN KEY FK_52A2D5E161220EA6');
$this->addSql('DROP TABLE agenda_event_invitation');
$this->addSql("ALTER TABLE agenda_event_invitee DROP FOREIGN KEY FK_4F5757FEA76ED395");
$this->addSql("DROP TABLE agenda_event_invitee");
$this->addSql('ALTER TABLE agenda_event_invitee DROP FOREIGN KEY FK_4F5757FEA76ED395');
$this->addSql('DROP TABLE agenda_event_invitee');
}
}
}

Loading…
Cancel
Save