1
1
<?php
2
+
2
3
/* For licensing terms, see /license.txt */
3
4
4
5
// resetting the course id
@@ -231,10 +232,10 @@ function search_users($needle, $type)
231
232
}
232
233
233
234
$ return .= Display::url (
234
- $ person_name ,
235
- 'javascript: void(0); ' ,
236
- ['onclick ' => "add_user_to_session(' " .$ user ['id ' ]."', ' " .addslashes ($ person_name )."'); " ]
237
- ).'<br> ' ;
235
+ $ person_name ,
236
+ 'javascript: void(0); ' ,
237
+ ['onclick ' => "add_user_to_session(' " .$ user ['id ' ]."', ' " .addslashes ($ person_name )."'); " ]
238
+ ).'<br> ' ;
238
239
} else {
239
240
$ return .= '...<br /> ' ;
240
241
}
@@ -250,7 +251,7 @@ function search_users($needle, $type)
250
251
$ officialCode = !empty ($ user ['official_code ' ]) ? $ user ['official_code ' ].' - ' : '? - ' ;
251
252
$ person_name = $ officialCode .$ user ['lastname ' ].' ' .$ user ['firstname ' ].' ( ' .$ user ['username ' ].') ' ;
252
253
}
253
- $ return .= '<option value=" ' .$ user ['id ' ].'"> ' .$ person_name .' </option> ' ;
254
+ $ return .= '<option value=" ' .$ user ['id ' ].'"> ' .trim ( $ person_name) .' </option> ' ;
254
255
}
255
256
$ return .= '</select> ' ;
256
257
$ xajax_response ->addAssign ('ajax_list_users_multiple ' , 'innerHTML ' , api_utf8_encode ($ return ));
@@ -560,32 +561,33 @@ function change_select(val) {
560
561
561
562
$ newLinks = Display::url (
562
563
Display::return_icon ('teacher.png ' , get_lang ('Enroll trainers from existing sessions ' ), null , ICON_SIZE_TINY ).
563
- get_lang ('Enroll trainers from existing sessions ' ),
564
+ get_lang ('Enroll trainers from existing sessions ' ),
564
565
api_get_path (WEB_CODE_PATH ).'session/add_teachers_to_session.php?id= ' .$ id_session
565
566
);
566
567
$ newLinks .= Display::url (
567
568
Display::return_icon ('user.png ' , get_lang ('Enroll trainers from existing sessions ' ), null , ICON_SIZE_TINY ).
568
- get_lang ('Enroll students from existing sessions ' ),
569
+ get_lang ('Enroll students from existing sessions ' ),
569
570
api_get_path (WEB_CODE_PATH ).'session/add_students_to_session.php?id= ' .$ id_session
570
571
);
572
+
573
+ echo '<div class="actions"> ' ;
574
+ echo $ link_add_type_unique ;
575
+ echo $ link_add_type_multiple ;
576
+ echo $ link_add_group ;
577
+ echo $ newLinks ;
578
+ echo '</div> ' ;
579
+
571
580
?>
572
- <div class="actions">
573
- <?php
574
- echo $ link_add_type_unique ;
575
- echo $ link_add_type_multiple ;
576
- echo $ link_add_group ;
577
- echo $ newLinks ;
578
- ?>
579
- </div>
580
581
<form name="formulaire" method="post"
581
- action="<?php echo api_get_self (); ?> ?page=<?php echo $ page ; ?> &id_session=<?php echo $ id_session ; ?> <?php if (!empty ($ addProcess )) {
582
- echo '&add=true ' ;
583
- } ?> " <?php if ($ ajax_search ) {
584
- echo ' onsubmit="valide();" ' ;
585
- } ?> >
582
+ action="<?php echo api_get_self (
583
+ ); ?> ?page=<?php echo $ page ; ?> &id_session=<?php echo $ id_session ; ?> <?php if (!empty ($ addProcess )) {
584
+ echo '&add=true ' ;
585
+ } ?> " <?php if ($ ajax_search ) {
586
+ echo ' onsubmit="valide();" ' ;
587
+ } ?> >
586
588
<?php echo '<legend> ' .$ tool_name .' ( ' .$ session_info ['name ' ].') </legend> ' ; ?>
587
589
<?php
588
- if ('multiple ' == $ add_type ) {
590
+ if ('multiple ' === $ add_type ) {
589
591
if (is_array ($ extra_field_list )) {
590
592
if (is_array ($ new_field_list ) && count ($ new_field_list ) > 0 ) {
591
593
echo '<h3> ' .get_lang ('Filter users ' ).'</h3> ' ;
@@ -638,12 +640,12 @@ function change_select(val) {
638
640
<div class="col-md-4">
639
641
<div class="form-group">
640
642
<?php
641
- if (!('multiple ' == $ add_type )) {
643
+ if (!('multiple ' === $ add_type )) {
642
644
?>
643
645
<input
644
- placeholder="<?php echo get_lang ('Search ' ); ?> "
645
- type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')"
646
- class="form-control"/>
646
+ placeholder="<?php echo get_lang ('Search ' ); ?> "
647
+ type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')"
648
+ class="form-control"/>
647
649
<div id="ajax_list_users_single" class="select-list-ajax"></div>
648
650
<?php
649
651
} else {
@@ -653,30 +655,25 @@ class="form-control"/>
653
655
class="form-control">
654
656
<?php
655
657
foreach ($ nosessionUsersList as $ uid => $ enreg ) {
656
- ?>
657
- <option value="<?php echo $ uid ; ?> " <?php if (in_array ($ uid , $ UserList )) {
658
- echo 'selected="selected" ' ;
659
- } ?> >
660
- <?php
661
- $ personName = $ enreg ['ln ' ].' ' .$ enreg ['fn ' ].' ( ' .$ enreg ['un ' ].') '
662
- .$ enreg ['official_code ' ];
658
+ $ selected = in_array ($ uid , $ UserList ) ? 'selected="selected" ' : '' ;
659
+ $ personName = $ enreg ['ln ' ].' ' .$ enreg ['fn ' ].' ( ' .$ enreg ['un ' ].') ' ;
660
+ if (!empty ($ enreg ['official_code ' ])) {
661
+ $ personName .= ' ' .$ enreg ['official_code ' ];
662
+ }
663
663
if ($ showOfficialCode ) {
664
- $ officialCode =
665
- !empty ($ enreg ['official_code ' ]) ? $ enreg ['official_code ' ].' - '
666
- : '? - ' ;
667
- $ personName =
668
- $ officialCode .$ enreg ['ln ' ].' ' .$ enreg ['fn ' ].' ( ' .$ enreg ['un ' ].') ' ;
664
+ $ officialCode = !empty ($ enreg ['official_code ' ]) ? $ enreg ['official_code ' ].' - ' : '? - ' ;
665
+ $ personName = $ officialCode .$ enreg ['ln ' ].' ' .$ enreg ['fn ' ].' ( ' .$ enreg ['un ' ].') ' ;
669
666
}
670
- echo $ personName ; ?>
671
- </option>
672
- <?php
667
+ echo "<option value=' $ uid' $ selected> $ personName</option> " ;
673
668
} ?>
674
669
</select>
675
670
</div>
676
671
<input type="checkbox" onchange="checked_in_no_session(this.checked);"
677
672
name="user_with_any_session" id="user_with_any_session_id">
678
673
<label
679
- for="user_with_any_session_id"><?php echo get_lang ('Users not registered in any session ' ); ?> </label>
674
+ for="user_with_any_session_id"><?php echo get_lang (
675
+ 'Users not registered in any session '
676
+ ); ?> </label>
680
677
<?php
681
678
}
682
679
unset($ nosessionUsersList );
@@ -685,24 +682,21 @@ class="form-control">
685
682
</div>
686
683
687
684
<div class="col-md-4">
688
- <?php if ('multiple ' == $ add_type ) {
689
- ?>
685
+ <?php if ('multiple ' === $ add_type ) {
686
+ ?>
690
687
<?php echo get_lang ('First letter (last name) ' ); ?> :
691
688
<select id="first_letter_user" name="firstLetterUser" onchange="change_select(this.value);">
692
689
<option value="%">--</option>
693
690
<?php
694
- echo Display:: get_alphabet_options (); ?>
691
+ echo Display::get_alphabet_options (); ?>
695
692
</select>
696
693
<br/>
697
694
<br/>
698
- <?php
699
- } ?>
695
+ <?php
696
+ } ?>
700
697
<div class="control-course">
701
698
<?php
702
699
if ($ ajax_search ) {
703
- ?>
704
-
705
- <?php
706
700
} else {
707
701
?>
708
702
<div class="separate-action">
@@ -719,7 +713,6 @@ class="form-control">
719
713
<em class="fa fa-chevron-left"></em>
720
714
</button>
721
715
</div>
722
-
723
716
<?php
724
717
}
725
718
if (!empty ($ addProcess )) {
@@ -737,12 +730,11 @@ class="form-control">
737
730
<select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15"
738
731
class="form-control">
739
732
</select>
740
- <br />
733
+ <br/>
741
734
<button style="display:none" id="remove_user" name="remove_user" class="btn btn-danger" type="button"
742
735
onclick="remove_item(document.getElementById('destination_users'))">
743
736
<?php echo get_lang ('Remove ' ); ?> <em class="fa fa-trash"></em>
744
737
</button>
745
-
746
738
</div>
747
739
</div>
748
740
</form>
0 commit comments