Skip to content

Commit 84a22f3

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents dbc94d9 + 2a543e0 commit 84a22f3

File tree

21 files changed

+2419
-2250
lines changed

21 files changed

+2419
-2250
lines changed

.github/workflows/behat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
yarn run encore production
9393
9494
- name: Install chrome
95-
uses: browser-actions/setup-chrome@v1
95+
uses: browser-actions/setup-chrome@v2
9696
id: setup-chrome
9797

9898
- name: Start chrome

assets/vue/views/sessionadmin/RegisterStudent.vue

Lines changed: 78 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,67 @@
5757
/>
5858
</div>
5959

60+
<p
61+
v-if="platformSessionAdminAccessAllUrls"
62+
class="text-gray-600 text-sm"
63+
>
64+
{{
65+
t(
66+
'This list displays users from all access URLs because the setting "session_admin_access_to_all_users_on_all_urls" is enabled.',
67+
)
68+
}}
69+
</p>
6070
<div
6171
v-if="matches.length"
62-
class="mt-6 border-t pt-4 space-y-3"
72+
class="mt-6 border-t pt-4"
6373
>
64-
<h4 class="font-medium text-gray-700">{{ t("Matching students") }} ({{ matches.length }})</h4>
65-
<ul class="divide-y">
66-
<li
67-
v-for="user in matches"
68-
:key="user.id"
69-
class="flex items-center justify-between py-2"
70-
>
71-
<div class="flex items-center gap-3">
72-
<img
73-
:src="user.illustrationUrl || '/img/icons/32/unknown.png'"
74-
:alt="user.fullname"
75-
class="w-10 h-10 rounded-full object-cover border"
76-
/>
77-
<div>
78-
<p class="text-sm font-medium">{{ user.fullname }}</p>
79-
<p class="text-xs text-gray-500">{{ user.email }}</p>
80-
</div>
81-
</div>
82-
83-
<Button
84-
icon="pi pi-send"
85-
size="small"
86-
:label="t('Send course')"
87-
@click="sendCourseTo(user)"
88-
/>
89-
</li>
90-
</ul>
74+
<h4 class="font-medium text-gray-90">{{ t("Matching students") }} ({{ matches.length }})</h4>
75+
<table class="min-w-full text-sm mt-4 border border-gray-25 rounded">
76+
<thead class="bg-gray-20 text-gray-90 font-medium">
77+
<tr>
78+
<th class="px-4 py-2 text-left">{{ t("Full name") }}</th>
79+
<th class="px-4 py-2 text-left">{{ t("Email") }}</th>
80+
<th class="px-4 py-2 text-left">{{ t("Active") }}</th>
81+
<th class="px-4 py-2 text-left">{{ t("Local user") }}</th>
82+
<th class="px-4 py-2 text-right"></th>
83+
</tr>
84+
</thead>
85+
<tbody class="divide-y divide-gray-25">
86+
<tr
87+
v-for="user in matches"
88+
:key="user.id"
89+
class="hover:bg-gray-10 transition-colors"
90+
>
91+
<td class="px-4 py-2 text-gray-90">
92+
{{ user.fullname }}
93+
</td>
94+
<td class="px-4 py-2 text-gray-90">
95+
{{ user.email }}
96+
</td>
97+
<td class="px-4 py-2">
98+
<span
99+
:class="user.isActive ? 'text-success' : 'text-danger'"
100+
class="font-semibold"
101+
>
102+
{{ user.isActive ? t("Active") : t("Inactive") }}
103+
</span>
104+
</td>
105+
<td class="px-4 py-2">
106+
<span :class="user.hasLocalAccess ? 'text-green-600' : 'text-yellow-600'">
107+
{{ user.hasLocalAccess ? t("Local user") : t("External user") }}
108+
</span>
109+
</td>
110+
<td class="px-4 py-2 text-right">
111+
<Button
112+
icon="pi pi-send"
113+
size="small"
114+
:label="t('Send course invitation')"
115+
@click="sendCourseTo(user)"
116+
/>
117+
</td>
118+
</tr>
119+
</tbody>
120+
</table>
91121
</div>
92122

93123
<Message
@@ -132,6 +162,13 @@
132162
:placeholder="extraFieldKey"
133163
class="w-full"
134164
/>
165+
<div class="flex items-center gap-2">
166+
<Checkbox
167+
v-model="createForm.sendEmail"
168+
:binary="true"
169+
/>
170+
<span>{{ t("Send access details to user by email") }}</span>
171+
</div>
135172
<div class="flex justify-end gap-2">
136173
<Button
137174
text
@@ -151,14 +188,15 @@
151188
</template>
152189

153190
<script setup>
154-
import { ref, watch } from "vue"
191+
import { computed, ref, watch } from "vue"
155192
import { useRoute } from "vue-router"
156193
import { useI18n } from "vue-i18n"
157194
import Card from "primevue/card"
158195
import InputText from "primevue/inputtext"
159196
import Button from "primevue/button"
160197
import Dialog from "primevue/dialog"
161198
import Message from "primevue/message"
199+
import Checkbox from "primevue/checkbox"
162200
import userService from "../../services/userService"
163201
import courseService from "../../services/courseService"
164202
import sessionService from "../../services/sessionService"
@@ -189,11 +227,16 @@ const createForm = ref({
189227
email: "",
190228
password: "",
191229
accessUrlId: 1,
230+
sendEmail: true,
192231
[extraFieldKey]: "",
193232
})
194233
195234
const createLoading = ref(false)
196235
236+
const platformSessionAdminAccessAllUrls = computed(
237+
() => platformConfigStore.getSetting("platform.session_admin_access_to_all_users_on_all_urls") === "true",
238+
)
239+
197240
loadCourse()
198241
async function loadCourse() {
199242
try {
@@ -264,7 +307,7 @@ async function sendCourseTo(user) {
264307
try {
265308
const session = await sessionService.createWithCoursesAndUsers(payload)
266309
await sessionService.sendCourseNotification(session.id, user.id)
267-
310+
await searchStudent()
268311
showSuccessNotification(`${t("Course sent to")} ${user.email}`)
269312
} catch (e) {
270313
console.error(e)
@@ -286,6 +329,7 @@ async function handleCreateUser() {
286329
lastname: createForm.value.lastname,
287330
password: pwd,
288331
accessUrlId: createForm.value.accessUrlId,
332+
sendEmail: createForm.value.sendEmail,
289333
}
290334
291335
if (extraFieldKey && createForm.value[extraFieldKey]) {
@@ -306,6 +350,8 @@ async function handleCreateUser() {
306350
307351
showCreateModal.value = false
308352
showSuccessNotification(t("User created") + `: ${newUser.email}\n${t("Password")}: ${pwd}`)
353+
newUser.isActive = true
354+
newUser.hasLocalAccess = true
309355
matches.value.unshift(newUser)
310356
} catch (e) {
311357
console.error(e)
@@ -323,6 +369,8 @@ watch(showCreateModal, (val) => {
323369
email: "",
324370
password: "",
325371
accessUrlId: window.access_url_id,
372+
sendEmail: true,
373+
[extraFieldKey]: "",
326374
}
327375
}
328376
})

0 commit comments

Comments
 (0)