Skip to content

"create_*_event" webservices - refs BT#17507 #3372

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

Open
wants to merge 23 commits into
base: 1.11.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e88b0b4
Moving learning path creation code to ORM classes - refs BT#17453
Jul 11, 2020
985f502
create_learningpath web service - refs BT#17453
Jul 11, 2020
45556c1
Minor code style fix - refs BT#17453
Jul 11, 2020
f9c228f
Minor code style fix (Scrutinizer feedback) - refs BT#17453
Jul 12, 2020
e2fa097
reusing 'Test Course' if already created - refs BT#17453
Jul 13, 2020
8081540
Course and LP can be created through ORM classes - refs BT#17453
Jul 13, 2020
e635976
Minor code fix (flintci) - refs BT#17453
Jul 13, 2020
2ff29d3
Minor code fixes (scrutinizer) - refs BT#17453
Jul 13, 2020
ba5beb6
ORM can create a user from username and email - refs BT#17507
Jul 13, 2020
1ef8c7a
'create_user_event' web service - refs BT#17507
Jul 13, 2020
8a38151
CalendarEvent id automatically set to iid value after creation - refs…
Jul 13, 2020
6926c91
'create_course_event' web service - refs BT#17507
Jul 13, 2020
61d4917
A SysCalendar event's default accessUrl is the current one
Jul 14, 2020
e28579f
'create_global_event' web service - refs BT#17507
Jul 14, 2020
34c0d83
Minor code style fix (scrutinizer) - refs BT#17507
Jul 14, 2020
2357adb
avoid integrity constraint violations on c_id - refs BT#17453
Jul 14, 2020
c464ee3
course settings creation moved to Course::createSettings - refs BT#17453
Jul 14, 2020
830d80b
api_get_*_entity instead of EntityRepository::find - refs BT#17453
Jul 15, 2020
068e020
Minor code style fix (FlintCI) - refs BT#17453
Jul 15, 2020
c72c2f9
Fixed resume_session.php bug introduced in commit 18f433 - refs BT#17453
Jul 20, 2020
ed53297
learning path removal does not cascade-remove its course - refs BT#17453
Jul 30, 2020
0520175
prevent AddCourse::register_course() from creating an extra AccessUrl…
Aug 17, 2020
dd7a008
Prevent AddCourse::register_course() from creating a wrong AccessUrlR…
Aug 17, 2020
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
2 changes: 1 addition & 1 deletion main/admin/course_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
$courseTeacherNames = [];
foreach ($course_teachers as $courseTeacherId) {
/** @var User $courseTeacher */
$courseTeacher = UserManager::getRepository()->find($courseTeacherId);
$courseTeacher = api_get_user_entity($courseTeacherId);
$courseTeacherNames[$courseTeacher->getId()] = UserManager::formatUserFullName($courseTeacher, true);
}

Expand Down
5 changes: 2 additions & 3 deletions main/auth/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ function show_image(image,width,height) {

$wrong_current_password = false;
$user_data = $form->getSubmitValues(1);
/** @var User $user */
$user = UserManager::getRepository()->find(api_get_user_id());
$user = api_get_user_entity();

// set password if a new one was provided
$validPassword = false;
Expand Down Expand Up @@ -664,7 +663,7 @@ function show_image(image,width,height) {

if ($hook) {
Database::getManager()->clear(User::class); // Avoid cache issue (user entity is used before)
$user = api_get_user_entity(api_get_user_id()); // Get updated user info for hook event
$user = api_get_user_entity(); // Get updated user info for hook event
$hook->setEventData(['user' => $user]);
$hook->notifyUpdateUser(HOOK_EVENT_TYPE_POST);
}
Expand Down
4 changes: 2 additions & 2 deletions main/course_home/course_home.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function buttonForAllShowHide()
/**
* @var Chamilo\UserBundle\Entity\User
*/
$user = UserManager::getRepository()->find(api_get_user_id());
$user = api_get_user_entity();
if ($user) {
foreach ($user->getCurrentlyAccessibleSessions() as $session) {
$redirectionTarget = api_get_self().'?id_session='.$session->getId();
Expand All @@ -253,7 +253,7 @@ function buttonForAllShowHide()
/**
* @var Chamilo\UserBundle\Entity\User
*/
$user = UserManager::getRepository()->find(api_get_user_id());
$user = api_get_user_entity();
if ($user && !$user->getCurrentlyAccessibleSessions()) {
// subscription was probably refused because user session expired, go back to page "about"
$redirectionTarget = api_get_path(WEB_PATH).'course/'.$courseId.'/about';
Expand Down
2 changes: 1 addition & 1 deletion main/cron/import_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ private function importCalendarStatic($file, $moveFile = true)
];
/** @var CItemProperty $itemProperty */
$itemProperty = $em->getRepository('ChamiloCourseBundle:CItemProperty')->findOneBy($criteria);
$courseEntity = $em->getRepository('ChamiloCoreBundle:Course')->find($courseInfo['real_id']);
$courseEntity = api_get_course_entity($courseInfo['real_id']);
if ($itemProperty && $courseEntity) {
$itemProperty->setCourse($courseEntity);
$em->persist($itemProperty);
Expand Down
3 changes: 1 addition & 2 deletions main/cron/user_import/resend_email_with_new_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
$pass = api_substr($row['username'], 0, 4).rand(0, 9).rand(0, 9);

if ($user) {
/** @var User $user */
$user = $repository->find($row['user_id']);
$user = api_get_user_entity($row['user_id']);
$user->setPlainPassword($pass);
$userManager->updateUser($user, true);
} else {
Expand Down
4 changes: 2 additions & 2 deletions main/inc/ajax/skill.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
exit;
}

$session = $em->getRepository('ChamiloCoreBundle:Session')->find($sessionId);
$session = api_get_session_entity($sessionId);
/** @var \Chamilo\SkillBundle\Entity\SkillRelItem $skillRelItem */
$skillRelItem = $em->getRepository('ChamiloSkillBundle:SkillRelItem')->findOneBy(
['itemId' => $itemId, 'itemType' => $typeId, 'skill' => $skillId]
Expand Down Expand Up @@ -498,7 +498,7 @@
$course = api_get_course_entity($courseId);
$skillUser->setCourse($course);
if (!empty($sessionId)) {
$session = $em->getRepository('ChamiloCoreBundle:Session')->find($sessionId);
$session = api_get_session_entity($sessionId);
$skillUser->setSession($session);
}

Expand Down
720 changes: 157 additions & 563 deletions main/inc/lib/add_course.lib.inc.php

Large diffs are not rendered by default.

Loading