Skip to content

Commit

Permalink
Merge pull request #155 from its4nas/develop
Browse files Browse the repository at this point in the history
Add Student Import tool: part 1
  • Loading branch information
hamedshehab authored Nov 24, 2024
2 parents 6e3800c + 53703af commit ba03cf2
Show file tree
Hide file tree
Showing 20 changed files with 494 additions and 8 deletions.
30 changes: 25 additions & 5 deletions academia/academia/doctype/lesson_template/lesson_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lesson_type",
"section_break_stfq",
"instructor",
"instructor_name",
"room",
"column_break_yvwh",
"group",
Expand All @@ -31,6 +32,7 @@
"saturday",
"monday",
"wednesday",
"lesson_day",
"from_time",
"column_break_fyil",
"sunday",
Expand Down Expand Up @@ -75,6 +77,7 @@
"fieldname": "program",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Program",
"mandatory_depends_on": "eval:doc.is_multi_group == 0;",
"options": "Program Specification"
Expand All @@ -86,8 +89,6 @@
{
"fieldname": "instructor",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Instructor",
"options": "Faculty Member",
"reqd": 1
Expand Down Expand Up @@ -143,16 +144,18 @@
},
{
"fieldname": "from_time",
"fieldtype": "Time",
"fieldtype": "Select",
"in_standard_filter": 1,
"label": "From Time",
"options": "\n8\n10\n12\n14\n16",
"reqd": 1
},
{
"fieldname": "to_time",
"fieldtype": "Time",
"fieldtype": "Select",
"in_standard_filter": 1,
"label": "To Time",
"options": "\n10\n12\n14\n16\n18",
"reqd": 1
},
{
Expand Down Expand Up @@ -255,11 +258,28 @@
"fieldname": "is_multi_group",
"fieldtype": "Check",
"label": "is Multi Group"
},
{
"fieldname": "lesson_day",
"fieldtype": "Select",
"label": "Lesson Day",
"options": "\nsaturday\nsunday\nmonday\ntuesday\nwednesday\nthursday",
"reqd": 1
},
{
"fetch_from": "instructor.faculty_member_name",
"fieldname": "instructor_name",
"fieldtype": "Data",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Instructor Name",
"read_only": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-11-11 09:50:03.182108",
"modified": "2024-11-18 10:14:51.032207",
"modified_by": "Administrator",
"module": "Academia",
"name": "Lesson Template",
Expand Down
9 changes: 6 additions & 3 deletions academia/academia/doctype/lesson_template/lesson_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ class LessonTemplate(Document):
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from academia.academia.doctype.multi_lesson_template.multi_lesson_template import MultiLessonTemplate
from frappe.types import DF

from academia.academia.doctype.multi_lesson_template.multi_lesson_template import MultiLessonTemplate

academic_term: DF.Link
academic_year: DF.Link
course: DF.Link
course_type: DF.Literal["", "Theoretical", "Practical"]
faculty: DF.Link
from_time: DF.Time
from_time: DF.Literal["", "8", "10", "12", "14", "16"]
group: DF.Link | None
instructor: DF.Link
instructor_name: DF.Data
is_multi_group: DF.Check
lesson_day: DF.Literal["", "saturday", "sunday", "monday", "tuesday", "wednesday", "thursday"]
lesson_type: DF.Literal["", "Ordinary Lesson", "Compensatory Lesson"]
level: DF.Link | None
monday: DF.Check
Expand All @@ -36,7 +39,7 @@ class LessonTemplate(Document):
sunday: DF.Check
table_ocar: DF.Table[MultiLessonTemplate]
thursday: DF.Check
to_time: DF.Time
to_time: DF.Literal["", "10", "12", "14", "16", "18"]
tuesday: DF.Check
wednesday: DF.Check
# end: auto-generated types
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, SanU and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Lesson Template Print", {
// refresh(frm) {

// },
// });
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-11-12 10:10:28.211386",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"section_break_ndqr",
"date_of_printing",
"faculty",
"schedule_template_version",
"column_break_hyqz",
"instructor",
"instructor_name",
"amended_from",
"instructor_data"
],
"fields": [
{
"fieldname": "section_break_ndqr",
"fieldtype": "Section Break"
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Lesson Template Print",
"print_hide": 1,
"read_only": 1,
"search_index": 1
},
{
"fieldname": "date_of_printing",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Date of Printing",
"reqd": 1
},
{
"fieldname": "instructor",
"fieldtype": "Link",
"label": "Instructor",
"options": "Faculty Member"
},
{
"fieldname": "column_break_hyqz",
"fieldtype": "Column Break"
},
{
"fieldname": "faculty",
"fieldtype": "Link",
"label": "Faculty",
"options": "Faculty",
"reqd": 1
},
{
"fieldname": "schedule_template_version",
"fieldtype": "Link",
"label": "Schedule Template Version",
"options": "Schedule Template Version"
},
{
"fetch_from": "instructor.faculty_member_name",
"fieldname": "instructor_name",
"fieldtype": "Data",
"label": "Instructor Name",
"read_only": 1
},
{
"fieldname": "instructor_data",
"fieldtype": "JSON",
"label": "Instructor Data"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-11-13 11:42:20.984634",
"modified_by": "Administrator",
"module": "Academia",
"name": "Lesson Template Print",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2024, SanU and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class LessonTemplatePrint(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from frappe.types import DF

amended_from: DF.Link | None
date_of_printing: DF.Date
faculty: DF.Link
instructor: DF.Link | None
instructor_data: DF.JSON | None
instructor_name: DF.Data | None
schedule_template_version: DF.Link | None
# end: auto-generated types
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, SanU and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestLessonTemplatePrint(FrappeTestCase):
pass
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2024, SanU and contributors
// For license information, please see license.txt

frappe.ui.form.on("Program Enrollment Tool", {
refresh: function (frm) {
// زر Import Data
frm.add_custom_button(
__("Import Data"),
function () {
// إعداد الرابط لشاشة Data Import
const url = frappe.urllib.get_full_url(
"/app/data-import/new?reference_doctype=Temporary Student&import_type=Insert New Records"
);

// فتح الرابط في نافذة جديدة
window.open(url, "_blank");
},
__("Actions")
);
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-11-23 11:30:29.686612",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"faculty",
"progarm",
"student_batch",
"column_break_idbd",
"academic_year",
"academic_term",
"level",
"section_break_eaqf",
"get_student",
"students"
],
"fields": [
{
"fieldname": "faculty",
"fieldtype": "Link",
"label": "Faculty",
"options": "Faculty"
},
{
"fieldname": "progarm",
"fieldtype": "Link",
"label": "Progarm",
"options": "Program Specification"
},
{
"fieldname": "student_batch",
"fieldtype": "Link",
"label": "Student Batch",
"options": "Student Batch"
},
{
"fieldname": "column_break_idbd",
"fieldtype": "Column Break"
},
{
"fieldname": "academic_year",
"fieldtype": "Link",
"label": "Academic Year",
"options": "Academic Year"
},
{
"fieldname": "academic_term",
"fieldtype": "Link",
"label": "Academic Term",
"options": "Academic Term"
},
{
"fieldname": "level",
"fieldtype": "Link",
"label": "Level",
"options": "Level"
},
{
"fieldname": "section_break_eaqf",
"fieldtype": "Section Break"
},
{
"fieldname": "get_student",
"fieldtype": "Button",
"label": "Get Student"
},
{
"fieldname": "students",
"fieldtype": "Table",
"label": "Students",
"options": "Temporary Student Temporary"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-11-23 12:05:41.494118",
"modified_by": "Administrator",
"module": "Academia",
"name": "Program Enrollment Tool",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Loading

0 comments on commit ba03cf2

Please sign in to comment.