@@ -83,7 +83,8 @@ public static function create_session(
83
83
$ start_limit = true ,
84
84
$ end_limit = true ,
85
85
$ fix_name = false ,
86
- $ duration = null
86
+ $ duration = null ,
87
+ $ showDescription = null
87
88
) {
88
89
global $ _configuration ;
89
90
@@ -203,6 +204,14 @@ public static function create_session(
203
204
Database::query ($ sql );
204
205
}
205
206
207
+ if (!is_null ($ showDescription )) {
208
+ $ showDescription = intval ($ showDescription );
209
+ $ sql = "UPDATE $ tbl_session
210
+ SET show_description = ' $ showDescription'
211
+ WHERE id = $ session_id " ;
212
+ Database::query ($ sql );
213
+ }
214
+
206
215
if (!empty ($ session_id )) {
207
216
/*
208
217
Sends a message to the user_id = 1
@@ -1313,20 +1322,20 @@ public static function generate_nice_next_session_name($session_name)
1313
1322
/**
1314
1323
* Edit a session
1315
1324
* @author Carlos Vargas from existing code
1316
- * @param integer id
1317
- * @param string name
1318
- * @param integer year_start
1319
- * @param integer month_start
1320
- * @param integer day_start
1321
- * @param integer year_end
1322
- * @param integer month_end
1323
- * @param integer day_end
1324
- * @param integer nb_days_acess_before
1325
- * @param integer nb_days_acess_after
1326
- * @param integer nolimit
1327
- * @param integer id_coach
1328
- * @param integer id_session_category
1329
- * @param int $id_visibility
1325
+ * @param integer id
1326
+ * @param string name
1327
+ * @param integer year_start
1328
+ * @param integer month_start
1329
+ * @param integer day_start
1330
+ * @param integer year_end
1331
+ * @param integer month_end
1332
+ * @param integer day_end
1333
+ * @param integer nb_days_acess_before
1334
+ * @param integer nb_days_acess_after
1335
+ * @param integer nolimit
1336
+ * @param integer id_coach
1337
+ * @param integer id_session_category
1338
+ * @param int $id_visibility
1330
1339
* @param bool
1331
1340
* @param bool
1332
1341
* @param string $description
@@ -3654,7 +3663,8 @@ static function importCSV(
3654
3663
$ updateCourseCoaches = false ,
3655
3664
$ sessionWithCoursesModifier = false ,
3656
3665
$ addOriginalCourseTeachersAsCourseSessionCoaches = true ,
3657
- $ removeAllTeachersFromCourse = true
3666
+ $ removeAllTeachersFromCourse = true ,
3667
+ $ showDescription = null
3658
3668
) {
3659
3669
$ content = file ($ file );
3660
3670
@@ -3682,6 +3692,10 @@ static function importCSV(
3682
3692
$ extraParameters .= ' , nb_days_access_after_end = ' .intval ($ daysCoachAccessAfterBeginning );
3683
3693
}
3684
3694
3695
+ if (!is_null ($ showDescription )) {
3696
+ $ extraParameters .= ' , show_description = ' .intval ($ showDescription );
3697
+ }
3698
+
3685
3699
$ tbl_session = Database::get_main_table (TABLE_MAIN_SESSION );
3686
3700
$ tbl_session_user = Database::get_main_table (TABLE_MAIN_SESSION_USER );
3687
3701
$ tbl_session_course = Database::get_main_table (TABLE_MAIN_SESSION_COURSE );
@@ -3749,10 +3763,10 @@ static function importCSV(
3749
3763
continue ;
3750
3764
}
3751
3765
3752
- $ date_start = $ enreg ['DateStart ' ];
3753
- $ date_end = $ enreg ['DateEnd ' ];
3754
- $ session_category_id = isset ($ enreg ['SessionCategory ' ]) ? $ enreg ['SessionCategory ' ] : null ;
3755
- $ sessionDescription = isset ($ enreg ['SessionDescription ' ]) ? $ enreg ['SessionDescription ' ] : null ;
3766
+ $ date_start = $ enreg ['DateStart ' ];
3767
+ $ date_end = $ enreg ['DateEnd ' ];
3768
+ $ session_category_id = isset ($ enreg ['SessionCategory ' ]) ? $ enreg ['SessionCategory ' ] : null ;
3769
+ $ sessionDescription = isset ($ enreg ['SessionDescription ' ]) ? $ enreg ['SessionDescription ' ] : null ;
3756
3770
3757
3771
$ extraSessionParameters = null ;
3758
3772
if (!empty ($ sessionDescription )) {
@@ -3893,6 +3907,10 @@ static function importCSV(
3893
3907
$ params ['description ' ] = $ sessionDescription ;
3894
3908
}
3895
3909
3910
+ if (!is_null ($ showDescription )) {
3911
+ $ params ['show_description ' ] = intval ($ showDescription );
3912
+ }
3913
+
3896
3914
if (!empty ($ fieldsToAvoidUpdate )) {
3897
3915
foreach ($ fieldsToAvoidUpdate as $ field ) {
3898
3916
unset($ params [$ field ]);
0 commit comments