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
Resolved merge conflicts with upstream/master
christianbeeznest committed Oct 9, 2024
commit 3f353ef517040cf8ddaf2f1a70281990ae37be47
25 changes: 15 additions & 10 deletions public/main/inc/lib/sessionmanager.lib.php
Original file line number Diff line number Diff line change
@@ -150,10 +150,6 @@ public static function create_session(
array $coachesId,
$sessionCategoryId,
$visibility = 1,
$parentId = null,
$daysBeforeFinishingForReinscription = null,
$lastRepetition = false,
$daysBeforeFinishingToCreateNewRepetition = null,
$fixSessionNameIfExists = false,
$duration = null,
$description = null,
@@ -163,7 +159,11 @@ public static function create_session(
$sendSubscriptionNotification = false,
$accessUrlId = 0,
$status = 0,
$notifyBoss = false
$notifyBoss = false,
$parentId = null,
$daysBeforeFinishingForReinscription = null,
$lastRepetition = false,
$daysBeforeFinishingToCreateNewRepetition = null
) {
global $_configuration;

@@ -230,6 +230,7 @@ public static function create_session(
->setDescription($description)
->setShowDescription(1 === $showDescription)
->setSendSubscriptionNotification((bool) $sendSubscriptionNotification)
->setNotifyBoss((bool) $notifyBoss)
->setParentId($parentId)
->setDaysToReinscription($daysBeforeFinishingForReinscription)
->setLastRepetition($lastRepetition)
@@ -1801,6 +1802,7 @@ public static function edit_session(
$sessionAdminId = 0,
$sendSubscriptionNotification = false,
$status = 0,
$notifyBoss = 0,
$parentId = 0,
$daysBeforeFinishingForReinscription = null,
$daysBeforeFinishingToCreateNewRepetition = null,
@@ -1874,6 +1876,10 @@ public static function edit_session(
->setVisibility($visibility)
->setSendSubscriptionNotification((bool) $sendSubscriptionNotification)
->setNotifyBoss((bool) $notifyBoss)
->setParentId($parentId)
->setDaysToReinscription($daysBeforeFinishingForReinscription)
->setLastRepetition($lastRepetition)
->setDaysToNewRepetition($daysBeforeFinishingToCreateNewRepetition)
->setAccessStartDate(null)
->setAccessStartDate(null)
->setDisplayStartDate(null)
@@ -8292,12 +8298,11 @@ public static function setForm(FormValidator $form, Session $session = null, $fr
$extra_field = new ExtraFieldModel('session');
$extra = $extra_field->addElements($form, $session ? $session->getId() : 0, ['image']);


if ('true' === api_get_setting('session.enable_auto_reinscription')) {
$form->addElement(
'text',
'days_before_finishing_for_reinscription',
get_lang('DaysBeforeFinishingForReinscription'),
get_lang('Days before finishing for reinscription'),
['maxlength' => 5]
);
}
@@ -8306,7 +8311,7 @@ public static function setForm(FormValidator $form, Session $session = null, $fr
$form->addElement(
'text',
'days_before_finishing_to_create_new_repetition',
get_lang('DaysBeforeFinishingToCreateNewRepetition'),
get_lang('Days before finishing to create new repetition'),
['maxlength' => 5]
);
}
@@ -8315,15 +8320,15 @@ public static function setForm(FormValidator $form, Session $session = null, $fr
$form->addElement(
'checkbox',
'last_repetition',
get_lang('LastRepetition')
get_lang('Last repetition')
);
}

/** @var HTML_QuickForm_select $element */
$element = $form->createElement(
'select',
'parent_id',
get_lang('ParentSession'),
get_lang('Parent session'),
[],
['class' => 'form-control']
);
16 changes: 10 additions & 6 deletions public/main/session/session_add.php
Original file line number Diff line number Diff line change
@@ -245,6 +245,10 @@ function (User $user) {
$session->getGeneralCoaches()->getValues()
),
'session_template' => $session->getTitle(),
'days_before_finishing_for_reinscription' => $session->getDaysToReinscription() ?? '',
'days_before_finishing_to_create_new_repetition' => $session->getDaysToNewRepetition() ?? '',
'last_repetition' => $session->getLastRepetition(),
'parent_id' => $session->getParentId() ?? 0,
];
} else {
$formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time();
@@ -326,20 +330,20 @@ function (User $user) {
$coachUsername,
$id_session_category,
$id_visibility,
$parentId,
$daysBeforeFinishingForReinscription,
$lastRepetition,
$daysBeforeFinishingToCreateNewRepetition,
false,
$duration,
$description,
$showDescription,
$extraFields,
null,
0,
$sendSubscriptionNotification,
api_get_current_access_url_id(),
$status,
$notifyBoss
$notifyBoss,
$parentId,
$daysBeforeFinishingForReinscription,
$lastRepetition,
$daysBeforeFinishingToCreateNewRepetition
);

if ($return == strval(intval($return))) {
1 change: 1 addition & 0 deletions public/main/session/session_edit.php
Original file line number Diff line number Diff line change
@@ -141,6 +141,7 @@ function (User $user) {
null,
$sendSubscriptionNotification,
$status,
$notifyBoss,
$parentId,
$daysBeforeFinishingForReinscription,
$daysBeforeFinishingToCreateNewRepetition,
19 changes: 19 additions & 0 deletions src/CoreBundle/Entity/Session.php
Original file line number Diff line number Diff line change
@@ -386,6 +386,9 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
#[ORM\Column(name: 'days_to_new_repetition', type: 'integer', nullable: true)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

protected ?int $daysToNewRepetition = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4


#[ORM\Column(name: 'notify_boss', type: 'boolean', options: ['default' => false])]
protected bool $notifyBoss = false;

public function __construct()
{
$this->skills = new ArrayCollection();
@@ -1469,6 +1472,7 @@ public function getParentId(): ?int
public function setParentId(?int $parentId): self
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

{
$this->parentId = $parentId;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8


return $this;
}

@@ -1480,6 +1484,7 @@ public function getDaysToReinscription(): ?int
public function setDaysToReinscription(?int $daysToReinscription): self
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

{
$this->daysToReinscription = $daysToReinscription;

return $this;
}

@@ -1491,6 +1496,7 @@ public function getLastRepetition(): bool
public function setLastRepetition(bool $lastRepetition): self
{
$this->lastRepetition = $lastRepetition;

return $this;
}

@@ -1502,6 +1508,19 @@ public function getDaysToNewRepetition(): ?int
public function setDaysToNewRepetition(?int $daysToNewRepetition): self
{
$this->daysToNewRepetition = $daysToNewRepetition;

return $this;
}

public function getNotifyBoss(): bool
{
return $this->notifyBoss;
}

public function setNotifyBoss(bool $notifyBoss): self
{
$this->notifyBoss = $notifyBoss;

return $this;
}
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.