Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal: Add session replication, reinscription logic, and child session hierarchy for course expiration - refs BT#22057 #5831

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ba4e25b
Internal: Add session replication, reinscription logic, and child ses…
christianbeeznest Sep 30, 2024
c3312db
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Oct 9, 2024
7f6e7ae
Session: Add settings and interface fields for session and lesson fun…
christianbeeznest Oct 9, 2024
3f353ef
Resolved merge conflicts with upstream/master
christianbeeznest Oct 9, 2024
2bf9adf
Internal: Add missing settings in migration - refs BT#22057
christianbeeznest Nov 26, 2024
d507e64
Resolved merge conflicts with upstream/master
christianbeeznest Nov 27, 2024
66a227d
Internal: Fix error type for validity_id_days field
christianbeeznest Nov 27, 2024
42f207b
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Nov 27, 2024
353c19a
Internal: Fix session duplication and reinscription logic improvement…
christianbeeznest Nov 27, 2024
238cbdb
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Nov 28, 2024
e9cca0b
Internal: Improve session reinscription logic using direct CLpView va…
christianbeeznest Nov 28, 2024
9cbcca1
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Nov 29, 2024
ba09140
Internal: Fix session duplication and reinscription logic - refs BT#2…
christianbeeznest Nov 29, 2024
8f8fa4f
Adding changes from upstream/master
christianbeeznest Dec 4, 2024
7b66599
Internal: Implement automatic session repetition and coach notificati…
christianbeeznest Dec 4, 2024
ad82e0b
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Dec 18, 2024
3b34dc1
Internal: Reinscription logic updated to use sessions' validity and g…
christianbeeznest Dec 18, 2024
47b034c
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Dec 31, 2024
8ca3304
Internal: Fix gradebook duplication, session course inclusion, query …
christianbeeznest Dec 31, 2024
4bb5dc7
Merge remote-tracking branch 'upstream/master' into matra-22057
christianbeeznest Jan 6, 2025
b21643c
Session: Adjust session-repetition logic and data association - refs …
christianbeeznest Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Internal: Add missing settings in migration - refs BT#22057
  • Loading branch information
christianbeeznest committed Nov 26, 2024
commit 2bf9adfb1eb48b9c196439caf4871d043f2c9976
26 changes: 23 additions & 3 deletions src/CoreBundle/Migrations/Schema/V200/Version20240928003000.php
Original file line number Diff line number Diff line change
@@ -8,13 +8,12 @@

use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;

final class Version20240928003000 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Add new fields to session and c_lp tables for handling reinscription and session repetition logic';
return 'Add new fields to session and c_lp tables for handling reinscription and session repetition logic, and insert new settings if not exist.';
}

public function up(Schema $schema): void
@@ -39,14 +38,31 @@ public function up(Schema $schema): void
}
}

// Add the field to the 'c_lp' (Learnpath) table
// Add fields to the 'c_lp' (Learnpath) table
if ($schemaManager->tablesExist('c_lp')) {
$clpTable = $schemaManager->listTableColumns('c_lp');

if (!isset($clpTable['validity_in_days'])) {
$this->addSql("ALTER TABLE c_lp ADD validity_in_days INT DEFAULT NULL");
}
}

// Insert new settings if not exist
$this->addSql("
INSERT INTO settings (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable, access_url_locked)
SELECT 'enable_auto_reinscription', NULL, NULL, 'session', '0', 'Enable Auto Reinscription', 'Allow users to be automatically reinscribed in new sessions.', '', NULL, 1, 1, 1
WHERE NOT EXISTS (
SELECT 1 FROM settings WHERE variable = 'enable_auto_reinscription'
)
");

$this->addSql("
INSERT INTO settings (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable, access_url_locked)
SELECT 'enable_session_replication', NULL, NULL, 'session', '0', 'Enable Session Replication', 'Allow replication of session data across instances.', '', NULL, 1, 1, 1
WHERE NOT EXISTS (
SELECT 1 FROM settings WHERE variable = 'enable_session_replication'
)
");
}

public function down(Schema $schema): void
@@ -79,5 +95,9 @@ public function down(Schema $schema): void
$this->addSql("ALTER TABLE c_lp DROP COLUMN validity_in_days");
}
}

// Remove settings
$this->addSql("DELETE FROM settings WHERE variable = 'enable_auto_reinscription'");
$this->addSql("DELETE FROM settings WHERE variable = 'enable_session_replication'");
}
}