Session: Fix calls to SessionManager::create_session

pull/3995/head
Angel Fernando Quiroz Campos 4 years ago
parent 121d2a8eda
commit c5b96cc3d5
  1. 2
      public/main/cron/create_course_sessions.php
  2. 2
      public/main/cron/import_csv.php
  3. 4
      public/main/inc/lib/sessionmanager.lib.php
  4. 5
      public/main/inc/lib/webservices/Rest.php
  5. 2
      public/main/session/session_add.php
  6. 10
      public/main/webservices/api/tests/CreateSessionFromModelTest.php
  7. 4
      public/main/webservices/api/tests/GetSessionFromExtraFieldTest.php
  8. 2
      public/main/webservices/api/tests/SubscribeUserToSessionFromUsernameTest.php
  9. 2
      public/main/webservices/registration.soap.php
  10. 2
      public/main/webservices/webservice_session.php

@ -173,7 +173,7 @@ function createCourseSessions($courses, $administratorId, $startDate, $endDate)
null,
null,
null,
$administratorId,
[$administratorId],
0,
SESSION_INVISIBLE
);

@ -2150,7 +2150,7 @@ class ImportCsv
$dateEnd,
$coachBefore,
$coachAfter,
$coachId,
[$coachId],
$categoryId,
$visibility
);

@ -150,7 +150,7 @@ class SessionManager
$displayEndDate,
$coachStartDate,
$coachEndDate,
$coachesId,
array $coachesId,
$sessionCategoryId,
$visibility = 1,
$fixSessionNameIfExists = false,
@ -4467,7 +4467,7 @@ class SessionManager
$s['display_end_date'],
$s['coach_access_start_date'],
$s['coach_access_end_date'],
(int) $s['id_coach'],
[(int) $s['id_coach']],
$s['session_category_id'],
(int) $s['visibility'],
true,

@ -1192,7 +1192,7 @@ class Rest extends WebService
$displayEndDate,
null,
null,
$coach_username,
[$coach_username],
null,
1,
false,
@ -1630,6 +1630,7 @@ class Rest extends WebService
}
$modelSession = SessionManager::fetch($modelSessionId);
$generalCoachesId = SessionManager::getGeneralCoachesIdForSession($modelSessionId);
$modelSession['accessUrlId'] = 1;
if (api_is_multiple_url_enabled()) {
@ -1646,7 +1647,7 @@ class Rest extends WebService
$endDate,
$startDate,
$endDate,
$modelSession['id_coach'],
$generalCoachesId,
$modelSession['session_category_id'],
$modelSession['visibility'],
false,

@ -350,7 +350,7 @@ $form->addButtonNext(get_lang('Next step'));
if (!$formSent) {
$formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time();
$formDefaults['coach_username'] = api_get_user_id();
$formDefaults['coach_username'] = [api_get_user_id()];
}
$form->setDefaults($formDefaults);

@ -32,7 +32,7 @@ class CreateSessionFromModelTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);
@ -92,7 +92,7 @@ class CreateSessionFromModelTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);
@ -142,7 +142,7 @@ class CreateSessionFromModelTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);
@ -188,7 +188,7 @@ class CreateSessionFromModelTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);
@ -242,7 +242,7 @@ class CreateSessionFromModelTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);

@ -60,7 +60,7 @@ class GetSessionFromExtraFieldTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);
$secondSessionId = SessionManager::create_session(
@ -71,7 +71,7 @@ class GetSessionFromExtraFieldTest extends V2TestCase
'2019-12-31 00:00',
'2019-09-01 00:00',
'2019-12-31 00:00',
null,
[],
null
);

@ -34,7 +34,7 @@ class SubscribeUserToSessionFromUsernameTest extends V2TestCase
'2019-08-31 00:00',
'2019-01-01 00:00',
'2019-08-31 00:00',
null,
[],
null
);

@ -4104,7 +4104,7 @@ function WSCreateSession($params)
$date_end,
$coachStartDate,
$coachEndDate,
$id_coach,
[$id_coach],
0,
1,
false,

@ -427,7 +427,7 @@ class WSSession extends WS
$end_date,
$coachStartDate,
$coachEndDate,
$user_id,
[$user_id],
0,
$visibility
);

Loading…
Cancel
Save