Merge pull request #5281 from christianbeeznest/GH-5145
	
		
	
				
					
				
			User: Remove PersonalAgenda and related tables - refs #5145pull/5283/head
						commit
						911b2b1a14
					
				@ -1,144 +0,0 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
declare(strict_types=1); | 
				
			||||
 | 
				
			||||
namespace Chamilo\CoreBundle\Entity; | 
				
			||||
 | 
				
			||||
use Chamilo\CoreBundle\Traits\UserTrait; | 
				
			||||
use DateTime; | 
				
			||||
use Doctrine\ORM\Mapping as ORM; | 
				
			||||
use Symfony\Component\Validator\Constraints as Assert; | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * PersonalAgenda. | 
				
			||||
 */ | 
				
			||||
#[ORM\Table(name: 'personal_agenda')] | 
				
			||||
#[ORM\Index(columns: ['user'], name: 'idx_personal_agenda_user')] | 
				
			||||
#[ORM\Index(columns: ['parent_event_id'], name: 'idx_personal_agenda_parent')] | 
				
			||||
#[ORM\Entity] | 
				
			||||
class PersonalAgenda | 
				
			||||
{ | 
				
			||||
    use UserTrait; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'id', type: 'integer')] | 
				
			||||
    #[ORM\Id] | 
				
			||||
    #[ORM\GeneratedValue] | 
				
			||||
    protected ?int $id = null; | 
				
			||||
 | 
				
			||||
    #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'personalAgendas')] | 
				
			||||
    #[ORM\JoinColumn(name: 'user', referencedColumnName: 'id', onDelete: 'CASCADE')] | 
				
			||||
    protected User $user; | 
				
			||||
 | 
				
			||||
    #[Assert\NotBlank] | 
				
			||||
    #[ORM\Column(name: 'title', type: 'text', nullable: true)] | 
				
			||||
    protected ?string $title = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'text', type: 'text', nullable: true)] | 
				
			||||
    protected ?string $text = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'date', type: 'datetime', nullable: true)] | 
				
			||||
    protected ?DateTime $date = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'enddate', type: 'datetime', nullable: true)] | 
				
			||||
    protected ?DateTime $endDate = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'parent_event_id', type: 'integer', nullable: true)] | 
				
			||||
    protected ?int $parentEventId = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'all_day', type: 'integer', nullable: false)] | 
				
			||||
    protected int $allDay; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'color', type: 'string', length: 20, nullable: true)] | 
				
			||||
    protected ?string $color = null; | 
				
			||||
 | 
				
			||||
    public function getId(): ?int | 
				
			||||
    { | 
				
			||||
        return $this->id; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getTitle(): ?string | 
				
			||||
    { | 
				
			||||
        return $this->title; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setTitle(string $title): self | 
				
			||||
    { | 
				
			||||
        $this->title = $title; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getText(): string | 
				
			||||
    { | 
				
			||||
        return $this->text; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setText(string $text): self | 
				
			||||
    { | 
				
			||||
        $this->text = $text; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getDate(): ?DateTime | 
				
			||||
    { | 
				
			||||
        return $this->date; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setDate(DateTime $date): self | 
				
			||||
    { | 
				
			||||
        $this->date = $date; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getEndDate(): ?DateTime | 
				
			||||
    { | 
				
			||||
        return $this->endDate; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setEndDate(DateTime $value): self | 
				
			||||
    { | 
				
			||||
        $this->endDate = $value; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getParentEventId(): ?int | 
				
			||||
    { | 
				
			||||
        return $this->parentEventId; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setParentEventId(int $parentEventId): self | 
				
			||||
    { | 
				
			||||
        $this->parentEventId = $parentEventId; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getAllDay(): int | 
				
			||||
    { | 
				
			||||
        return $this->allDay; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setAllDay(int $allDay): self | 
				
			||||
    { | 
				
			||||
        $this->allDay = $allDay; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getColor(): ?string | 
				
			||||
    { | 
				
			||||
        return $this->color; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function setColor(string $color): self | 
				
			||||
    { | 
				
			||||
        $this->color = $color; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -1,132 +0,0 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
declare(strict_types=1); | 
				
			||||
 | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
namespace Chamilo\CoreBundle\Entity; | 
				
			||||
 | 
				
			||||
use Doctrine\ORM\Mapping as ORM; | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * PersonalAgendaRepeat. | 
				
			||||
 */ | 
				
			||||
#[ORM\Table(name: 'personal_agenda_repeat')] | 
				
			||||
#[ORM\Entity] | 
				
			||||
class PersonalAgendaRepeat | 
				
			||||
{ | 
				
			||||
    #[ORM\Column(name: 'cal_id', type: 'integer')] | 
				
			||||
    #[ORM\Id] | 
				
			||||
    #[ORM\GeneratedValue(strategy: 'IDENTITY')] | 
				
			||||
    protected int $calId; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'cal_type', type: 'string', length: 20, nullable: true)] | 
				
			||||
    protected ?string $calType = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'cal_end', type: 'integer', nullable: true)] | 
				
			||||
    protected ?int $calEnd = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'cal_frequency', type: 'integer', nullable: true)] | 
				
			||||
    protected ?int $calFrequency = null; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'cal_days', type: 'string', length: 7, nullable: true)] | 
				
			||||
    protected ?string $calDays = null; | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calType. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeat | 
				
			||||
     */ | 
				
			||||
    public function setCalType(string $calType) | 
				
			||||
    { | 
				
			||||
        $this->calType = $calType; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calType. | 
				
			||||
     * | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function getCalType() | 
				
			||||
    { | 
				
			||||
        return $this->calType; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calEnd. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeat | 
				
			||||
     */ | 
				
			||||
    public function setCalEnd(int $calEnd) | 
				
			||||
    { | 
				
			||||
        $this->calEnd = $calEnd; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calEnd. | 
				
			||||
     * | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getCalEnd() | 
				
			||||
    { | 
				
			||||
        return $this->calEnd; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calFrequency. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeat | 
				
			||||
     */ | 
				
			||||
    public function setCalFrequency(int $calFrequency) | 
				
			||||
    { | 
				
			||||
        $this->calFrequency = $calFrequency; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calFrequency. | 
				
			||||
     * | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getCalFrequency() | 
				
			||||
    { | 
				
			||||
        return $this->calFrequency; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calDays. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeat | 
				
			||||
     */ | 
				
			||||
    public function setCalDays(string $calDays) | 
				
			||||
    { | 
				
			||||
        $this->calDays = $calDays; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calDays. | 
				
			||||
     * | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function getCalDays() | 
				
			||||
    { | 
				
			||||
        return $this->calDays; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calId. | 
				
			||||
     * | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getCalId() | 
				
			||||
    { | 
				
			||||
        return $this->calId; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -1,71 +0,0 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
declare(strict_types=1); | 
				
			||||
 | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
namespace Chamilo\CoreBundle\Entity; | 
				
			||||
 | 
				
			||||
use Doctrine\ORM\Mapping as ORM; | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * PersonalAgendaRepeatNot. | 
				
			||||
 */ | 
				
			||||
#[ORM\Table(name: 'personal_agenda_repeat_not')] | 
				
			||||
#[ORM\Entity] | 
				
			||||
class PersonalAgendaRepeatNot | 
				
			||||
{ | 
				
			||||
    #[ORM\Column(name: 'cal_id', type: 'integer')] | 
				
			||||
    #[ORM\Id] | 
				
			||||
    #[ORM\GeneratedValue(strategy: 'NONE')] | 
				
			||||
    protected int $calId; | 
				
			||||
 | 
				
			||||
    #[ORM\Column(name: 'cal_date', type: 'integer')] | 
				
			||||
    #[ORM\Id] | 
				
			||||
    #[ORM\GeneratedValue(strategy: 'NONE')] | 
				
			||||
    protected int $calDate; | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calId. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeatNot | 
				
			||||
     */ | 
				
			||||
    public function setCalId(int $calId) | 
				
			||||
    { | 
				
			||||
        $this->calId = $calId; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calId. | 
				
			||||
     * | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getCalId() | 
				
			||||
    { | 
				
			||||
        return $this->calId; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Set calDate. | 
				
			||||
     * | 
				
			||||
     * @return PersonalAgendaRepeatNot | 
				
			||||
     */ | 
				
			||||
    public function setCalDate(int $calDate) | 
				
			||||
    { | 
				
			||||
        $this->calDate = $calDate; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * Get calDate. | 
				
			||||
     * | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getCalDate() | 
				
			||||
    { | 
				
			||||
        return $this->calDate; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -0,0 +1,39 @@ | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
declare(strict_types=1); | 
				
			||||
 | 
				
			||||
namespace Chamilo\CoreBundle\Migrations\Schema\V200; | 
				
			||||
 | 
				
			||||
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; | 
				
			||||
use Doctrine\DBAL\Schema\Schema; | 
				
			||||
 | 
				
			||||
class Version20240321142500 extends AbstractMigrationChamilo | 
				
			||||
{ | 
				
			||||
    public function getDescription(): string | 
				
			||||
    { | 
				
			||||
        return 'Remove personal agenda related tables'; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function up(Schema $schema): void | 
				
			||||
    { | 
				
			||||
        $this->addSql('DROP TABLE IF EXISTS personal_agenda'); | 
				
			||||
        $this->addSql('DROP TABLE IF EXISTS personal_agenda_repeat'); | 
				
			||||
        $this->addSql('DROP TABLE IF EXISTS personal_agenda_repeat_not'); | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function down(Schema $schema): void | 
				
			||||
    { | 
				
			||||
        if (!$schema->hasTable('personal_agenda')) { | 
				
			||||
            $this->addSql('CREATE TABLE personal_agenda (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, title TEXT DEFAULT NULL, text TEXT DEFAULT NULL, date DATETIME DEFAULT NULL, enddate DATETIME DEFAULT NULL, parent_event_id INT DEFAULT NULL, all_day INT NOT NULL, color VARCHAR(20) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | 
				
			||||
        } | 
				
			||||
 | 
				
			||||
        if (!$schema->hasTable('personal_agenda_repeat')) { | 
				
			||||
            $this->addSql('CREATE TABLE personal_agenda_repeat (cal_id INT AUTO_INCREMENT NOT NULL, cal_type VARCHAR(20) DEFAULT NULL, cal_end INT DEFAULT NULL, cal_frequency INT DEFAULT NULL, cal_days VARCHAR(7) DEFAULT NULL, PRIMARY KEY(cal_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | 
				
			||||
        } | 
				
			||||
 | 
				
			||||
        if (!$schema->hasTable('personal_agenda_repeat_not')) { | 
				
			||||
            $this->addSql('CREATE TABLE personal_agenda_repeat_not (cal_id INT NOT NULL, cal_date INT NOT NULL, PRIMARY KEY(cal_id, cal_date)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | 
				
			||||
        } | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue