diff --git a/frontend/src/components/Controls/Link.vue b/frontend/src/components/Controls/Link.vue
index c5f6f63f..c3f007b2 100644
--- a/frontend/src/components/Controls/Link.vue
+++ b/frontend/src/components/Controls/Link.vue
@@ -108,6 +108,7 @@ const options = createResource({
url: 'frappe.desk.search.search_link',
cache: [props.doctype, text.value],
method: 'POST',
+ auto: true,
params: {
txt: text.value,
doctype: props.doctype,
diff --git a/frontend/src/components/Controls/Rating.vue b/frontend/src/components/Controls/Rating.vue
index bde1bb9f..d79ee99e 100644
--- a/frontend/src/components/Controls/Rating.vue
+++ b/frontend/src/components/Controls/Rating.vue
@@ -4,11 +4,10 @@
{{ props.label }}
-
- {{ rating }}
+
@@ -18,7 +17,7 @@
diff --git a/frontend/src/components/Modals/Event.vue b/frontend/src/components/Modals/Event.vue
index 69eb4dff..670189f2 100644
--- a/frontend/src/components/Modals/Event.vue
+++ b/frontend/src/components/Modals/Event.vue
@@ -11,76 +11,118 @@
{{ event.title }}
-
-
-
-
- {{ event.course_title }}
-
-
-
-
-
- {{ dayjs(event.date).format("DD MMM YYYY") }}
-
-
-
-
-
- {{ formatTime(event.start_time) }} - {{ formatTime(event.end_time) }}
-
-
-
-
-
- {{ event.member }}
-
-
+
+
+
+
+
+ {{ event.member }}
+
+
+
+
+
+
+
+ {{ event.course_title }}
+
+
+
+
+
+
+
+ {{ event.batch_title }}
+
+
+
+
+
+
+
+ {{ dayjs(event.date).format("DD MMM YYYY") }}
+
+
+
+
+
+
+
+ {{ formatTime(event.start_time) }} - {{ formatTime(event.end_time) }}
+
+
+
+
+
+
+
-
-
-
- {{ evaluation.rating }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/pages/ProfileEvaluationSchedule.vue b/frontend/src/pages/ProfileEvaluationSchedule.vue
index 920815b6..f40ebc78 100644
--- a/frontend/src/pages/ProfileEvaluationSchedule.vue
+++ b/frontend/src/pages/ProfileEvaluationSchedule.vue
@@ -7,7 +7,7 @@
defaultMode: 'Month',
disableModes: ['Day', 'Week'],
redundantCellHeight: 100,
- enableShortcuts: true,
+ enableShortcuts: false,
}"
:events="evaluations.data"
@click="(event) => openEvent(event)"
@@ -62,7 +62,7 @@ const evaluations = createListResource({
filters: {
"evaluator": user.data?.name
},
- fields: ["name", "member_name", "member", "course", "course_title", "date", "start_time", "end_time", "google_meet_link"],
+ fields: ["name", "member_name", "member", "course", "course_title", "batch_name", "batch_title", "date", "start_time", "end_time", "google_meet_link"],
auto: true,
cache: ["schedule", user.data?.name],
transform(data) {
@@ -80,6 +80,8 @@ const evaluations = createListResource({
course: d.course,
course_title: d.course_title,
member: d.member,
+ batch_name: d.batch_name,
+ batch_title: d.batch_title
}
})
},
diff --git a/lms/lms/api.py b/lms/lms/api.py
index 01d21b81..0eb23c13 100644
--- a/lms/lms/api.py
+++ b/lms/lms/api.py
@@ -7,7 +7,7 @@ from frappe import _
from frappe.query_builder import DocType
from frappe.query_builder.functions import Count
from frappe.utils import time_diff, now_datetime, get_datetime
-
+from typing import Optional
@frappe.whitelist()
def autosave_section(section, code):
@@ -616,6 +616,7 @@ def check_app_permission():
def save_evaluation_details(
member: str,
course: str,
+ batch_name: str,
date: str,
start_time: str,
end_time: str,
@@ -635,17 +636,60 @@ def save_evaluation_details(
"start_time": start_time,
"end_time": end_time,
"status": status,
- "rating": rating,
- "summary": summary
+ "rating": rating / 5,
+ "summary": summary,
+ "batch_name": batch_name
}
if evaluation:
- doc = frappe.db.set_value("LMS Certificate Evaluation", evaluation, details)
+ frappe.db.set_value("LMS Certificate Evaluation", evaluation, details)
+ return evaluation
else:
doc = frappe.new_doc("LMS Certificate Evaluation")
details.update({
"member": member,
- "course": course
+ "course": course,
})
doc.update(details)
- doc.insert()
\ No newline at end of file
+ doc.insert()
+ return doc.name
+
+
+@frappe.whitelist()
+def save_certificate_details(
+ member: str,
+ course: str,
+ batch_name: str,
+ issue_date,
+ expiry_date,
+ template,
+ published=True,
+ ) -> None:
+ """
+ Save certificate details for a member against a course.
+ """
+ certificate = frappe.db.exists("LMS Certificate", {
+ "member": member,
+ "course": course
+ })
+
+ details = {
+ "published": published,
+ "issue_date": issue_date,
+ "expiry_date": expiry_date,
+ "template": template,
+ "batch_name": batch_name
+ }
+
+ if certificate:
+ frappe.db.set_value("LMS Certificate", certificate, details)
+ return certificate
+ else:
+ doc = frappe.new_doc("LMS Certificate")
+ details.update({
+ "member": member,
+ "course": course,
+ })
+ doc.update(details)
+ doc.insert()
+ return doc.name
\ No newline at end of file
diff --git a/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json b/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
index 8d097905..affb3411 100644
--- a/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
+++ b/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
@@ -8,12 +8,16 @@
"field_order": [
"member",
"member_name",
+ "column_break_ueht",
"course",
+ "batch_name",
+ "section_break_zwfi",
+ "evaluator",
+ "evaluator_name",
"column_break_5",
"date",
"start_time",
"end_time",
- "batch_name",
"section_break_6",
"rating",
"status",
@@ -103,11 +107,33 @@
"in_standard_filter": 1,
"label": "Batch Name",
"options": "LMS Batch"
+ },
+ {
+ "fieldname": "column_break_ueht",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_zwfi",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "evaluator",
+ "fieldtype": "Link",
+ "label": "Evaluator",
+ "options": "User",
+ "reqd": 1
+ },
+ {
+ "fetch_from": "evaluator.full_name",
+ "fieldname": "evaluator_name",
+ "fieldtype": "Data",
+ "label": "Evaluator Name",
+ "read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2024-07-16 14:06:11.977666",
+ "modified": "2024-09-10 20:17:49.908093",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Evaluation",
diff --git a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
index af99ba31..ebc2dae0 100644
--- a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
+++ b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
@@ -16,6 +16,7 @@
"evaluator_name",
"column_break_sjco",
"batch_name",
+ "batch_title",
"timezone",
"section_break_lifi",
"date",
@@ -137,11 +138,18 @@
"fieldtype": "Data",
"label": "Timezone",
"read_only": 1
+ },
+ {
+ "fetch_from": "batch_name.title",
+ "fieldname": "batch_title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Batch Title"
}
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2024-09-06 18:39:53.551920",
+ "modified": "2024-09-10 13:13:48.282623",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Request",