diff --git a/main/cron/import_csv.php b/main/cron/import_csv.php index c6ed7b5cde..779c192290 100755 --- a/main/cron/import_csv.php +++ b/main/cron/import_csv.php @@ -1038,7 +1038,8 @@ class ImportCsv null, $coachUserName, $categoryId, - $visibility + $visibility, + 1 ); if (is_numeric($result)) { @@ -1084,7 +1085,11 @@ class ImportCsv null, $coachId, $categoryId, - $visibility + $visibility, + true, //$start_limit = + true, //$end_limit = + null, //$description + 1 // $showDescription = null, ); if (is_numeric($result)) { @@ -1208,7 +1213,10 @@ class ImportCsv $avoid, false, // deleteUsersNotInList false, // updateCourseCoaches - true // sessionWithCoursesModifier + true, // sessionWithCoursesModifier + true, //$addOriginalCourseTeachersAsCourseSessionCoaches + true, //$removeAllTeachersFromCourse + 1 // $showDescription ); if (!empty($result['error_message'])) { diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index add6c39bac..d6340eb239 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -83,7 +83,8 @@ class SessionManager $start_limit = true, $end_limit = true, $fix_name = false, - $duration = null + $duration = null, + $showDescription = null ) { global $_configuration; @@ -203,6 +204,14 @@ class SessionManager Database::query($sql); } + if (!is_null($showDescription)) { + $showDescription = intval($showDescription); + $sql = "UPDATE $tbl_session + SET show_description = '$showDescription' + WHERE id = $session_id"; + Database::query($sql); + } + if (!empty($session_id)) { /* Sends a message to the user_id = 1 @@ -1313,20 +1322,20 @@ class SessionManager /** * Edit a session * @author Carlos Vargas from existing code - * @param integer id - * @param string name - * @param integer year_start - * @param integer month_start - * @param integer day_start - * @param integer year_end - * @param integer month_end - * @param integer day_end - * @param integer nb_days_acess_before - * @param integer nb_days_acess_after - * @param integer nolimit - * @param integer id_coach - * @param integer id_session_category - * @param int $id_visibility + * @param integer id + * @param string name + * @param integer year_start + * @param integer month_start + * @param integer day_start + * @param integer year_end + * @param integer month_end + * @param integer day_end + * @param integer nb_days_acess_before + * @param integer nb_days_acess_after + * @param integer nolimit + * @param integer id_coach + * @param integer id_session_category + * @param int $id_visibility * @param bool * @param bool * @param string $description @@ -3654,7 +3663,8 @@ class SessionManager $updateCourseCoaches = false, $sessionWithCoursesModifier = false, $addOriginalCourseTeachersAsCourseSessionCoaches = true, - $removeAllTeachersFromCourse = true + $removeAllTeachersFromCourse = true, + $showDescription = null ) { $content = file($file); @@ -3682,6 +3692,10 @@ class SessionManager $extraParameters .= ' , nb_days_access_after_end = '.intval($daysCoachAccessAfterBeginning); } + if (!is_null($showDescription)) { + $extraParameters .= ' , show_description = '.intval($showDescription); + } + $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); @@ -3749,10 +3763,10 @@ class SessionManager continue; } - $date_start = $enreg['DateStart']; - $date_end = $enreg['DateEnd']; - $session_category_id = isset($enreg['SessionCategory']) ? $enreg['SessionCategory'] : null; - $sessionDescription = isset($enreg['SessionDescription']) ? $enreg['SessionDescription'] : null; + $date_start = $enreg['DateStart']; + $date_end = $enreg['DateEnd']; + $session_category_id = isset($enreg['SessionCategory']) ? $enreg['SessionCategory'] : null; + $sessionDescription = isset($enreg['SessionDescription']) ? $enreg['SessionDescription'] : null; $extraSessionParameters = null; if (!empty($sessionDescription)) { @@ -3893,6 +3907,10 @@ class SessionManager $params['description'] = $sessionDescription; } + if (!is_null($showDescription)) { + $params['show_description'] = intval($showDescription); + } + if (!empty($fieldsToAvoidUpdate)) { foreach ($fieldsToAvoidUpdate as $field) { unset($params[$field]);