chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
769 stars 470 forks source link

Course Registration while Private Access #2805

Open yourKatharsis opened 5 years ago

yourKatharsis commented 5 years ago

Is your feature request related to a problem? Please describe. When a student tries to sign up to a course with the settings "Private access (access authorized to group members only)" and "Registration: This function is only available to trainers", heshe comes to the page /courses/COURSENAME/index.php?action=subscribe&sec_token=xxxx* (See screenshot below). I think the message can be confusing for the user.

Describe the solution you'd like The student can sign up for the course, but the teacher has to confirm the registration. The student sees a message like "Registration successful, wait for confirmation".

Another possible change can be, to replace the button "Registration" on /course/COURSEID/about with something like "Self Sign up not allowed".

Additional context image Chamilo 1.11.8

yourKatharsis commented 5 years ago

I'm not that familiar with PHP, but I try to figure out a solution:

In /main/course_info/about.php I add on line 152 (Inside the array $courseItem):

'allow_subscribe' => $course->getSubscribe(),

Seconde I modified the template at /main/template/custom/course_home/about.tpl (88-103):

<h3>{{ 'CourseSubscription'|get_lang }}</h3>
<div class="session-subscribe">
    {% if _u.logged == 0 %}
        {% if 'allow_registration'|api_get_setting != 'false' %}
            <a href="{{ _p.web_main ~ 'auth/inscription.php' ~ redirect_to_session }}" class="btn btn-success btn-block btn-lg">
                <i class="fa fa-pencil" aria-hidden="true"></i> {{ 'SignUp'|get_lang }}
            </a>
        {% endif %}
    {% elseif course.subscription %}
        <a href="{{ _p.web }}courses/{{ course.code }}/index.php?id_session=0" class="btn btn-lg btn-success btn-block">{{ 'CourseHomepage'|get_lang }}</a>
    {% elseif course.allow_subscribe %}
        <a href="{{ _p.web }}courses/{{ course.code }}/index.php?action=subscribe&sec_token={{ token }}" class="btn btn-lg btn-success btn-block">{{ 'Subscribe'|get_lang }}</a>
    {% else %}
        <p>{{ 'RegistrationNotAllow'|get_lang }}</p>
    {% endif %}
</div>

In /main/lang/[lang]/trad4all.inc.php I add the variable

$RegistrationNotAllow = "Self enrollment not possible. Please contact the teacher."
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ywarnier commented 1 year ago

@BorjaSanchezBeezNest to review together with me when you get to it