chamilo/chamilo-lms

View on GitHub
public/main/admin/subscribe_user2course.php

Summary

Maintainability
A
0 mins
Test Coverage

Variable "this_section" is not in valid camel caps format
Open

$this_section = SECTION_PLATFORM_ADMIN;

Variable "link_add_group" is not in valid camel caps format
Open

echo Display::toolbarAction('subscribe', [$link_add_group]);

Variable "extra_field" is not in valid camel caps format
Open

        if (1 == $extra_field[8] && ExtraField::FIELD_TYPE_TAG == $extra_field[2]) {

Variable "extra_field" is not in valid camel caps format
Open

                'name' => $extra_field[3],

Variable "target_name" is not in valid camel caps format
Open

$orderBy = $target_name;

Spaces must be used for alignment; tabs are not allowed
Open

 *    This script allows platform admins to add users to courses.

Variable "tbl_user" is not in valid camel caps format
Open

$tbl_user = Database::get_main_table(TABLE_MAIN_USER);

Variable "new_field" is not in valid camel caps format
Open

            $fieldtype = $new_field['type'];

Variable "extra_field_result" is not in valid camel caps format
Open

                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);

Variable "where_filter" is not in valid camel caps format
Open

            $where_filter = " AND u.id IN  ('".implode("','", $final_result)."') ";

Variable "tool_name" is not in valid camel caps format
Open

Display :: display_header($tool_name);

Variable "first_letter_course" is not in valid camel caps format
Open

    $first_letter_course = Database::escape_string($_POST['firstLetterCourse']);

Variable "user_id" is not in valid camel caps format
Open

                    $user = api_get_user_info($user_id);

Variable "use_extra_fields" is not in valid camel caps format
Open

$use_extra_fields = false;

Variable "final_result" is not in valid camel caps format
Open

    $final_result = [];

Variable "extra_field_result" is not in valid camel caps format
Open

            if (is_array($extra_field_result[$i + 1])) {

Variable "final_result" is not in valid camel caps format
Open

        $final_result = $extra_field_result[0];

Variable "final_result" is not in valid camel caps format
Open

        if (is_array($final_result) && count($final_result) > 0) {

Variable "where_filter" is not in valid camel caps format
Open

            $where_filter = " AND id  = -1";

Variable "access_url_id" is not in valid camel caps format
Open

                    access_url_id =  $access_url_id AND

Variable "extra_field" is not in valid camel caps format
Open

                'name' => $extra_field[3],

Variable "extra_field" is not in valid camel caps format
Open

                'type' => $extra_field[2],

Variable "extra_field" is not in valid camel caps format
Open

            $options = UserManager::get_extra_user_data_for_tags($extra_field[1]);

Variable "form_sent" is not in valid camel caps format
Open

    if (1 == $form_sent) {

Variable "tbl_user" is not in valid camel caps format
Open

    $sql = "SELECT count(*) as nb_users FROM $tbl_user";

Variable "new_field_list" is not in valid camel caps format
Open

        foreach ($new_field_list as $new_field) {

Variable "use_extra_fields" is not in valid camel caps format
Open

                    $use_extra_fields = true;

Variable "extra_field_result" is not in valid camel caps format
Open

                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);

Variable "target_name" is not in valid camel caps format
Open

        WHERE id <>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter

Variable "access_url_id" is not in valid camel caps format
Open

    $access_url_id = api_get_current_access_url_id();

Variable "new_field_list" is not in valid camel caps format
Open

    if (is_array($new_field_list) && count($new_field_list) > 0) {

Variable "new_field_list" is not in valid camel caps format
Open

    if (is_array($new_field_list) && count($new_field_list) > 0) {

Variable "extra_field_result" is not in valid camel caps format
Open

        for ($i = 0; $i < count($extra_field_result) - 1; $i++) {

Variable "where_filter" is not in valid camel caps format
Open

        WHERE id <>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter

Variable "db_users" is not in valid camel caps format
Open

$db_users = Database::store_result($result);

Variable "form_sent" is not in valid camel caps format
Open

$form_sent = 0;

Variable "first_letter_user" is not in valid camel caps format
Open

    $first_letter_user = Database::escape_string($_POST['firstLetterUser']);

Variable "num_row" is not in valid camel caps format
Open

    if ($num_row['nb_users'] > 1000) {

Variable "tbl_course_rel_access_url" is not in valid camel caps format
Open

    $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);

Variable "extra_field" is not in valid camel caps format
Open

        if (1 == $extra_field[8] && ExtraField::FIELD_TYPE_TAG == $extra_field[2]) {

Variable "course_code" is not in valid camel caps format
Open

            foreach ($courses as $course_code) {

Variable "first_letter_user" is not in valid camel caps format
Open

        $first_letter_user = 'A';

Variable "where_filter" is not in valid camel caps format
Open

            $where_filter = " AND u.id  = -1";

Spaces must be used for alignment; tabs are not allowed
Open

 *    you can select multiple users and courses and then click on

Variable "tool_name" is not in valid camel caps format
Open

$form->addElement('header', '', $tool_name);

Variable "form_sent" is not in valid camel caps format
Open

    $form_sent = $_POST['form_sent'];

Variable "new_field" is not in valid camel caps format
Open

            if (UserManager::is_extra_field_available($new_field['variable'])) {

Variable "final_result" is not in valid camel caps format
Open

                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);

Variable "final_result" is not in valid camel caps format
Open

        if (is_array($final_result) && count($final_result) > 0) {

Variable "final_result" is not in valid camel caps format
Open

            $where_filter = " AND u.id IN  ('".implode("','", $final_result)."') ";

Variable "final_result" is not in valid camel caps format
Open

            $where_filter = " AND id IN  ('".implode("','", $final_result)."') ";

Variable "target_name" is not in valid camel caps format
Open

$target_name = 'lastname';

Variable "access_url_id" is not in valid camel caps format
Open

    if (-1 != $access_url_id) {

Variable "first_letter_course" is not in valid camel caps format
Open

        WHERE visual_code LIKE '".$first_letter_course."%'

Spaces must be used for alignment; tabs are not allowed
Open

 *     @todo use formvalidator for the form

Variable "new_field" is not in valid camel caps format
Open

                            $new_field['variable'],

Variable "use_extra_fields" is not in valid camel caps format
Open

if ($use_extra_fields) {

Variable "extra_field_result" is not in valid camel caps format
Open

        $final_result = $extra_field_result[0];

Variable "tbl_user_rel_access_url" is not in valid camel caps format
Open

                INNER JOIN $tbl_user_rel_access_url user_rel_url

Spaces must be used for alignment; tabs are not allowed
Open

 *    'Add to this(these) course(s)'.

Variable "first_letter_user" is not in valid camel caps format
Open

$first_letter_user = '';

Variable "extra_field" is not in valid camel caps format
Open

        if (1 == $extra_field[8] && ExtraField::FIELD_TYPE_SELECT == $extra_field[2]) {

Variable "new_field_list" is not in valid camel caps format
Open

            $new_field_list[] = [

Variable "first_letter_user" is not in valid camel caps format
Open

if (empty($first_letter_user)) {

Variable "result_list" is not in valid camel caps format
Open

        $result_list = [];

Variable "tbl_user_rel_access_url" is not in valid camel caps format
Open

    $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);

Variable "extra_field_list" is not in valid camel caps format
Open

$extra_field_list = UserManager::get_extra_fields();

Variable "new_field_list" is not in valid camel caps format
Open

$new_field_list = [];

Variable "extra_field_list" is not in valid camel caps format
Open

if (is_array($extra_field_list)) {

Variable "extra_field" is not in valid camel caps format
Open

        if (1 == $extra_field[8] && ExtraField::FIELD_TYPE_SELECT == $extra_field[2]) {

Variable "extra_field" is not in valid camel caps format
Open

                'variable' => $extra_field[1],

Variable "extra_field" is not in valid camel caps format
Open

                'type' => $extra_field[2],

Variable "extra_field" is not in valid camel caps format
Open

                'variable' => $extra_field[1],

Variable "num_row" is not in valid camel caps format
Open

    $num_row = Database::fetch_array($result);

Variable "extra_field_list" is not in valid camel caps format
Open

if (is_array($extra_field_list)) {

Variable "new_field" is not in valid camel caps format
Open

            $varname = 'field_'.$new_field['variable'];

Variable "final_result" is not in valid camel caps format
Open

        if (is_array($final_result) && count($final_result) > 0) {

Variable "tbl_user" is not in valid camel caps format
Open

                FROM $tbl_user u

Spaces must be used for alignment; tabs are not allowed
Open

 *    It displays a list of users and a list of courses;

Variable "extra_field_list" is not in valid camel caps format
Open

    foreach ($extra_field_list as $extra_field) {

Variable "extra_field" is not in valid camel caps format
Open

                'data' => $extra_field[9],

Variable "new_field" is not in valid camel caps format
Open

        foreach ($new_field_list as $new_field) {

Variable "extra_field_result" is not in valid camel caps format
Open

    if (count($extra_field_result) > 1) {

Variable "tbl_user" is not in valid camel caps format
Open

        FROM $tbl_user

Variable "target_name" is not in valid camel caps format
Open

                    (".$target_name." LIKE '".$first_letter_user."%' )

Variable "tbl_course" is not in valid camel caps format
Open

        FROM $tbl_course

Variable "tbl_course" is not in valid camel caps format
Open

$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);

Variable "extra_field" is not in valid camel caps format
Open

    foreach ($extra_field_list as $extra_field) {

Variable "where_filter" is not in valid camel caps format
Open

$where_filter = null;

Variable "first_letter_user" is not in valid camel caps format
Open

        WHERE id <>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter

Variable "first_letter_user" is not in valid camel caps format
Open

                    (".$target_name." LIKE '".$first_letter_user."%' )

Variable "access_url_id" is not in valid camel caps format
Open

    $access_url_id = api_get_current_access_url_id();

Variable "link_add_group" is not in valid camel caps format
Open

$link_add_group = '<a href="usergroups.php">'.

Variable "user_id" is not in valid camel caps format
Open

                foreach ($users as $user_id) {

Variable "extra_field_result" is not in valid camel caps format
Open

                        $extra_field_result[] = UserManager::get_extra_user_data_by_tags(

Variable "extra_field_result" is not in valid camel caps format
Open

                        $extra_field_result[] = UserManager::get_extra_user_data_by_value(

Variable "where_filter" is not in valid camel caps format
Open

            $where_filter = " AND id IN  ('".implode("','", $final_result)."') ";

Variable "where_filter" is not in valid camel caps format
Open

                    $where_filter

Variable "first_letter_course" is not in valid camel caps format
Open

$first_letter_course = '';

Variable "tool_name" is not in valid camel caps format
Open

$tool_name = get_lang('Add users to course');

Variable "new_field_list" is not in valid camel caps format
Open

            $new_field_list[] = [

Variable "course_code" is not in valid camel caps format
Open

                        $courseInfo = api_get_course_info($course_code);

Variable "user_id" is not in valid camel caps format
Open

                        CourseManager::subscribeUser($user_id, $courseInfo['real_id']);

Variable "extra_field_result" is not in valid camel caps format
Open

$extra_field_result = [];

Variable "final_result" is not in valid camel caps format
Open

        if (is_array($final_result) && count($final_result) > 0) {

Variable "db_users" is not in valid camel caps format
Open

    <?php foreach ($db_users as $user) {

Closing brace indented incorrectly; expected 8 spaces, found 10
Open

          } ?>>

Variable "tbl_course_rel_access_url" is not in valid camel caps format
Open

                INNER JOIN $tbl_course_rel_access_url course_rel_url

Variable "new_field" is not in valid camel caps format
Open

            foreach ($new_field['data'] as $option) {

Variable "access_url_id" is not in valid camel caps format
Open

    if (-1 != $access_url_id) {

Variable "access_url_id" is not in valid camel caps format
Open

                    access_url_id =  $access_url_id  AND

Variable "new_field" is not in valid camel caps format
Open

        foreach ($new_field_list as $new_field) {

Variable "first_letter_course" is not in valid camel caps format
Open

      echo Display :: get_alphabet_options($first_letter_course);

Variable "extra_field_list" is not in valid camel caps format
Open

if (is_array($extra_field_list)) {

Closing brace indented incorrectly; expected 4 spaces, found 6
Open

      } ?>

Variable "db_courses" is not in valid camel caps format
Open

$db_courses = Database::store_result($result);

Variable "new_field" is not in valid camel caps format
Open

            $fieldtype = $new_field['type'];

Variable "new_field_list" is not in valid camel caps format
Open

    if (is_array($new_field_list) && count($new_field_list) > 0) {

Variable "new_field_list" is not in valid camel caps format
Open

        foreach ($new_field_list as $new_field) {

Variable "new_field" is not in valid camel caps format
Open

            $varname = 'field_'.$new_field['variable'];

Variable "first_letter_user" is not in valid camel caps format
Open

        echo Display :: get_alphabet_options($first_letter_user);

Closing brace indented incorrectly; expected 9 spaces, found 10
Open

          } ?>>

Variable "first_letter_course" is not in valid camel caps format
Open

                    (visual_code LIKE '".$first_letter_course."%' )

Variable "tbl_course" is not in valid camel caps format
Open

                FROM $tbl_course as course

Variable "new_field_list" is not in valid camel caps format
Open

    if (is_array($new_field_list) && count($new_field_list) > 0) {

Closing brace indented incorrectly; expected 4 spaces, found 6
Open

      } ?>

Variable "db_courses" is not in valid camel caps format
Open

    <?php foreach ($db_courses as $course) {

Variable "new_field" is not in valid camel caps format
Open

            echo $new_field['name'];

Closing brace indented incorrectly; expected 4 spaces, found 6
Open

      } ?>

Line indented incorrectly; expected at least 16 spaces, found 14
Open

              echo 'selected="selected"';

Line indented incorrectly; expected 16 spaces, found 13
Open

             <?php echo '('.$course['visual_code'].') '.$course['title']; ?>

Line indented incorrectly; expected 8 spaces, found 6
Open

      <?php

Line indented incorrectly; expected 12 spaces, found 10
Open

          ?>

Closing brace indented incorrectly; expected 4 spaces, found 6
Open

      } ?>

Line indented incorrectly; expected 8 spaces, found 6
Open

      <?php

Line indented incorrectly; expected 8 spaces, found 6
Open

      ?>

Line indented incorrectly; expected 12 spaces, found 10
Open

          ?>

Line indented incorrectly; expected 0 spaces, found 10
Open

          } ?>>

Line indented incorrectly; expected 0 spaces, found 6
Open

      } ?>

Line indented incorrectly; expected 8 spaces, found 6
Open

      ?>

Line indented incorrectly; expected 8 spaces, found 6
Open

      <?php

Line indented incorrectly; expected 8 spaces, found 10
Open

          }

Line indented incorrectly; expected 8 spaces, found 10
Open

          if ($showOfficialCode) {

Line indented incorrectly; expected at least 16 spaces, found 14
Open

              echo 'selected="selected"';

Closing brace indented incorrectly; expected 25 spaces, found 10
Open

          } ?>>

Line indented incorrectly; expected 0 spaces, found 6
Open

      } ?>

Line indented incorrectly; expected at least 8 spaces, found 6
Open

      echo Display :: get_alphabet_options($first_letter_course);

Line indented incorrectly; expected 0 spaces, found 10
Open

          } ?>>

Closing brace indented incorrectly; expected 24 spaces, found 10
Open

          } ?>>

There are no issues that match your filters.

Category
Status