From 0364944bd494af86bd51a507bde11f27331c8f7c Mon Sep 17 00:00:00 2001 From: alshujaarajeh Date: Thu, 1 Aug 2024 02:49:45 +0530 Subject: [PATCH 1/3] Feat(/student_research.js):Edite in Validation in js. --- .../student_research/student_research.js | 107 +++++++++++++++++- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/psa/psa_registration/doctype/student_research/student_research.js b/psa/psa_registration/doctype/student_research/student_research.js index d3d98d5..447239f 100644 --- a/psa/psa_registration/doctype/student_research/student_research.js +++ b/psa/psa_registration/doctype/student_research/student_research.js @@ -1,8 +1,103 @@ -// Copyright (c) 2024, Sana'a university and contributors -// For license information, please see license.txt +frappe.ui.form.on("Student Research", { + refresh: function(frm) { + if(frm.doc.docstatus === 1){ + if(!frm.doc.status){ + frm.add_custom_button(__('Changed '), function() { + frappe.call({ + method: 'psa.psa_registration.doctype.student_research.student_research.select_data', + args: { + condition_value: frm.doc.name, + status:"Changed" + }, + }); + frappe.show_alert({ + message: __('the statues was succsuful changed to Changed'), + indicator: 'green' + }); + frm.reload_doc(); + setTimeout(function() { + frm.reload_doc(); + }, 1000); + }, __('statues')); + } + else if(frm.doc.status === "Changed"){ + frm.add_custom_button(__('active '), function() { + frappe.call({ + method: 'psa.psa_registration.doctype.student_research.student_research.select_data', + args: { + condition_value: frm.doc.name, + status:"Active" + }, + + }); + frappe.show_alert({ + message: __('the statues was succsuful changed to Active'), + indicator: 'green' + }); + frm.reload_doc(); + setTimeout(function() { + frm.reload_doc(); + }, 1000); + + }, __('statues')); + } -// frappe.ui.form.on("Student Research", { -// refresh(frm) { + + -// }, -// }); + } + + } + +}); + + +frappe.listview_settings['Student Research'] = { + add_fields: ['status', 'docstatus'], + get_indicator: function(doc) { + // Customize how indicators appear in the list view + if (doc.status === 'Active') { + return [__('Active'), 'green', 'docstatus,=,Active']; + } else if (doc.status === 'Changed') { + return [__('Changed'), 'red', 'docstatus,=,Changed']; + } else { + return [__('Pending'), 'orange', 'docstatus,=,Pending']; + } + } +}; + +frappe.ui.form.on("Student Research", "onload", function(frm) { + + + // Fetch data from the Doctype + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student", + fields: ["name"], + filters: { + user_id:frappe.session.user_email + } + }, + callback: function(r) { + frm.set_value('student', r.message[0].name); + + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["program"], + filters: { + student:r.message[0].name, + status:"Active" + } + }, + callback: function(s) { + frm.set_value('program__enrollment', s.message[0].program); + + + } + }); + } + }); + }); \ No newline at end of file From a121a183e1006328b7b6ceceb5cd5a0076858ddc Mon Sep 17 00:00:00 2001 From: azozalkadry Date: Thu, 1 Aug 2024 04:24:32 +0530 Subject: [PATCH 2/3] Feat(Student Research):Edite in Validation in js. --- .../student_research/student_research.js | 107 +----------------- 1 file changed, 6 insertions(+), 101 deletions(-) diff --git a/psa/psa_registration/doctype/student_research/student_research.js b/psa/psa_registration/doctype/student_research/student_research.js index 447239f..d3d98d5 100644 --- a/psa/psa_registration/doctype/student_research/student_research.js +++ b/psa/psa_registration/doctype/student_research/student_research.js @@ -1,103 +1,8 @@ -frappe.ui.form.on("Student Research", { - refresh: function(frm) { - if(frm.doc.docstatus === 1){ - if(!frm.doc.status){ - frm.add_custom_button(__('Changed '), function() { - frappe.call({ - method: 'psa.psa_registration.doctype.student_research.student_research.select_data', - args: { - condition_value: frm.doc.name, - status:"Changed" - }, - }); - frappe.show_alert({ - message: __('the statues was succsuful changed to Changed'), - indicator: 'green' - }); - frm.reload_doc(); - setTimeout(function() { - frm.reload_doc(); - }, 1000); - }, __('statues')); - } - else if(frm.doc.status === "Changed"){ - frm.add_custom_button(__('active '), function() { - frappe.call({ - method: 'psa.psa_registration.doctype.student_research.student_research.select_data', - args: { - condition_value: frm.doc.name, - status:"Active" - }, - - }); - frappe.show_alert({ - message: __('the statues was succsuful changed to Active'), - indicator: 'green' - }); - frm.reload_doc(); - setTimeout(function() { - frm.reload_doc(); - }, 1000); - - }, __('statues')); - } +// Copyright (c) 2024, Sana'a university and contributors +// For license information, please see license.txt - - +// frappe.ui.form.on("Student Research", { +// refresh(frm) { - } - - } - -}); - - -frappe.listview_settings['Student Research'] = { - add_fields: ['status', 'docstatus'], - get_indicator: function(doc) { - // Customize how indicators appear in the list view - if (doc.status === 'Active') { - return [__('Active'), 'green', 'docstatus,=,Active']; - } else if (doc.status === 'Changed') { - return [__('Changed'), 'red', 'docstatus,=,Changed']; - } else { - return [__('Pending'), 'orange', 'docstatus,=,Pending']; - } - } -}; - -frappe.ui.form.on("Student Research", "onload", function(frm) { - - - // Fetch data from the Doctype - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Student", - fields: ["name"], - filters: { - user_id:frappe.session.user_email - } - }, - callback: function(r) { - frm.set_value('student', r.message[0].name); - - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Program Enrollment", - fields: ["program"], - filters: { - student:r.message[0].name, - status:"Active" - } - }, - callback: function(s) { - frm.set_value('program__enrollment', s.message[0].program); - - - } - }); - } - }); - }); \ No newline at end of file +// }, +// }); From 5cb9cbaaa8312c1ec853d1db290bf00f104f1d42 Mon Sep 17 00:00:00 2001 From: azozalkadry Date: Sun, 15 Sep 2024 03:12:59 +0530 Subject: [PATCH 3/3] Refactor(Psa Module):add , modified doctypes and add validation --- .../__init__.py | 0 .../accreditation_report.js} | 2 +- .../accreditation_report.json | 136 +++++++++++++ .../accreditation_report.py} | 2 +- .../test_accreditation_report.py} | 2 +- .../__init__.py | 0 .../accreditation_report_child.js} | 2 +- .../accreditation_report_child.json | 69 +++++++ .../accreditation_report_child.py} | 2 +- .../test_accreditation_report_child.py} | 2 +- .../appoint_student_research.json | 180 ------------------ .../__init__.py | 0 .../appoint_supervisor_and_defense.js | 74 +++++++ .../appoint_supervisor_and_defense.json | 101 ++++++++++ .../appoint_supervisor_and_defense.py | 9 + .../test_appoint_supervisor_and_defense.py | 9 + .../initial_research_defense.js | 102 +++++----- .../initial_research_defense.json | 40 ++-- .../request_a_supervisor_child.json | 14 +- .../request_co_supervisor.js | 43 ++++- .../request_co_supervisor.json | 39 +--- .../request_for_research_proposal_defense.js | 73 +++++++ ...request_for_research_proposal_defense.json | 22 ++- .../request_main_supervisor.js | 75 ++++---- .../request_main_supervisor.json | 13 +- ...minar_discussion_committee_membe_report.js | 99 +++++++--- ...nar_discussion_committee_membe_report.json | 8 +- ...eminar_discussion_faculty_member_report.js | 52 ++++- .../student_co_supervisor.json | 141 -------------- .../student_research/student_research.js | 28 ++- .../student_research/student_research.json | 21 +- .../student_research/student_research.py | 11 +- .../student_supervisor/student_supervisor.js | 51 ++++- .../student_supervisor.json | 5 +- .../summary_accreditation_report/__init__.py | 0 .../summary_accreditation_report.js | 38 ++++ .../summary_accreditation_report.json | 109 +++++++++++ .../summary_accreditation_report.py | 9 + .../test_summary_accreditation_report.py | 9 + 39 files changed, 1065 insertions(+), 527 deletions(-) rename psa/psa_registration/doctype/{appoint_student_research => accreditation_report}/__init__.py (100%) rename psa/psa_registration/doctype/{student_co_supervisor/student_co_supervisor.js => accreditation_report/accreditation_report.js} (75%) create mode 100644 psa/psa_registration/doctype/accreditation_report/accreditation_report.json rename psa/psa_registration/doctype/{student_co_supervisor/student_co_supervisor.py => accreditation_report/accreditation_report.py} (82%) rename psa/psa_registration/doctype/{student_co_supervisor/test_student_co_supervisor.py => accreditation_report/test_accreditation_report.py} (75%) rename psa/psa_registration/doctype/{student_co_supervisor => accreditation_report_child}/__init__.py (100%) rename psa/psa_registration/doctype/{appoint_student_research/appoint_student_research.js => accreditation_report_child/accreditation_report_child.js} (73%) create mode 100644 psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.json rename psa/psa_registration/doctype/{appoint_student_research/appoint_student_research.py => accreditation_report_child/accreditation_report_child.py} (80%) rename psa/psa_registration/doctype/{appoint_student_research/test_appoint_student_research.py => accreditation_report_child/test_accreditation_report_child.py} (73%) delete mode 100644 psa/psa_registration/doctype/appoint_student_research/appoint_student_research.json create mode 100644 psa/psa_registration/doctype/appoint_supervisor_and_defense/__init__.py create mode 100644 psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.js create mode 100644 psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.json create mode 100644 psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.py create mode 100644 psa/psa_registration/doctype/appoint_supervisor_and_defense/test_appoint_supervisor_and_defense.py delete mode 100644 psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.json create mode 100644 psa/psa_registration/doctype/summary_accreditation_report/__init__.py create mode 100644 psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.js create mode 100644 psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.json create mode 100644 psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.py create mode 100644 psa/psa_registration/doctype/summary_accreditation_report/test_summary_accreditation_report.py diff --git a/psa/psa_registration/doctype/appoint_student_research/__init__.py b/psa/psa_registration/doctype/accreditation_report/__init__.py similarity index 100% rename from psa/psa_registration/doctype/appoint_student_research/__init__.py rename to psa/psa_registration/doctype/accreditation_report/__init__.py diff --git a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.js b/psa/psa_registration/doctype/accreditation_report/accreditation_report.js similarity index 75% rename from psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.js rename to psa/psa_registration/doctype/accreditation_report/accreditation_report.js index 8460f34..e776a18 100644 --- a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.js +++ b/psa/psa_registration/doctype/accreditation_report/accreditation_report.js @@ -1,7 +1,7 @@ // Copyright (c) 2024, Sana'a university and contributors // For license information, please see license.txt -// frappe.ui.form.on("Student Co-Supervisor", { +// frappe.ui.form.on("Accreditation Report", { // refresh(frm) { // }, diff --git a/psa/psa_registration/doctype/accreditation_report/accreditation_report.json b/psa/psa_registration/doctype/accreditation_report/accreditation_report.json new file mode 100644 index 0000000..a597c99 --- /dev/null +++ b/psa/psa_registration/doctype/accreditation_report/accreditation_report.json @@ -0,0 +1,136 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-08-03 22:03:30.487985", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "appoint_supervisor_and_defense", + "program_enrollment", + "research_title_english", + "research_proposal", + "column_break_bmgj", + "student", + "supervisor", + "research_title_arabic", + "section_break_hawp", + "council", + "record_number", + "decision", + "column_break_vzym", + "description" + ], + "fields": [ + { + "fieldname": "appoint_supervisor_and_defense", + "fieldtype": "Link", + "label": "Appoint Supervisor and Defense", + "options": "Appoint Supervisor and Defense" + }, + { + "fetch_from": "appoint_supervisor_and_defense.student", + "fieldname": "student", + "fieldtype": "Data", + "label": "Student", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.supervisor", + "fieldname": "supervisor", + "fieldtype": "Data", + "label": "Supervisor", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.program_enrollment", + "fieldname": "program_enrollment", + "fieldtype": "Data", + "label": "Program Enrollment", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_title_english", + "fieldname": "research_title_english", + "fieldtype": "Data", + "label": "Research Title English", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_title_arabic", + "fieldname": "research_title_arabic", + "fieldtype": "Data", + "label": "Research Title Arabic", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_proposal", + "fieldname": "research_proposal", + "fieldtype": "Attach", + "label": " Research Proposal", + "read_only": 1 + }, + { + "fieldname": "column_break_bmgj", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_hawp", + "fieldtype": "Section Break" + }, + { + "fieldname": "council", + "fieldtype": "Link", + "label": "Council", + "options": "Employee", + "read_only": 1 + }, + { + "fieldname": "record_number", + "fieldtype": "Int", + "label": "Record Number", + "read_only": 1 + }, + { + "fieldname": "decision", + "fieldtype": "Select", + "label": "Decision", + "options": "\nAccepte\nReject", + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "options": "\n", + "read_only": 1 + }, + { + "fieldname": "column_break_vzym", + "fieldtype": "Column Break" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-03 22:24:05.842809", + "modified_by": "Administrator", + "module": "PSA Registration", + "name": "Accreditation Report", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.py b/psa/psa_registration/doctype/accreditation_report/accreditation_report.py similarity index 82% rename from psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.py rename to psa/psa_registration/doctype/accreditation_report/accreditation_report.py index 38c7d86..9e9b98a 100644 --- a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.py +++ b/psa/psa_registration/doctype/accreditation_report/accreditation_report.py @@ -5,5 +5,5 @@ from frappe.model.document import Document -class StudentCoSupervisor(Document): +class AccreditationReport(Document): pass diff --git a/psa/psa_registration/doctype/student_co_supervisor/test_student_co_supervisor.py b/psa/psa_registration/doctype/accreditation_report/test_accreditation_report.py similarity index 75% rename from psa/psa_registration/doctype/student_co_supervisor/test_student_co_supervisor.py rename to psa/psa_registration/doctype/accreditation_report/test_accreditation_report.py index 8bc8e53..4ed3028 100644 --- a/psa/psa_registration/doctype/student_co_supervisor/test_student_co_supervisor.py +++ b/psa/psa_registration/doctype/accreditation_report/test_accreditation_report.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestStudentCoSupervisor(FrappeTestCase): +class TestAccreditationReport(FrappeTestCase): pass diff --git a/psa/psa_registration/doctype/student_co_supervisor/__init__.py b/psa/psa_registration/doctype/accreditation_report_child/__init__.py similarity index 100% rename from psa/psa_registration/doctype/student_co_supervisor/__init__.py rename to psa/psa_registration/doctype/accreditation_report_child/__init__.py diff --git a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.js b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.js similarity index 73% rename from psa/psa_registration/doctype/appoint_student_research/appoint_student_research.js rename to psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.js index 9fb2a2e..86ec6e9 100644 --- a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.js +++ b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.js @@ -1,7 +1,7 @@ // Copyright (c) 2024, Sana'a university and contributors // For license information, please see license.txt -// frappe.ui.form.on("Appoint Student Research", { +// frappe.ui.form.on("Accreditation Report Child", { // refresh(frm) { // }, diff --git a/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.json b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.json new file mode 100644 index 0000000..7d7b510 --- /dev/null +++ b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.json @@ -0,0 +1,69 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-08-03 22:21:59.709796", + "default_view": "List", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "section_break_hawp", + "council", + "record_number", + "decision", + "column_break_vzym", + "description" + ], + "fields": [ + { + "fieldname": "section_break_hawp", + "fieldtype": "Section Break" + }, + { + "fieldname": "council", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Council", + "options": "Employee", + "read_only": 1 + }, + { + "fieldname": "record_number", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Record Number", + "read_only": 1 + }, + { + "fieldname": "decision", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Decision", + "options": "\nAccepte", + "read_only": 1 + }, + { + "fieldname": "column_break_vzym", + "fieldtype": "Column Break" + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "options": "\n", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2024-08-03 22:35:08.328804", + "modified_by": "Administrator", + "module": "PSA Registration", + "name": "Accreditation Report Child", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.py b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.py similarity index 80% rename from psa/psa_registration/doctype/appoint_student_research/appoint_student_research.py rename to psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.py index 7a6e6da..784528b 100644 --- a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.py +++ b/psa/psa_registration/doctype/accreditation_report_child/accreditation_report_child.py @@ -5,5 +5,5 @@ from frappe.model.document import Document -class AppointStudentResearch(Document): +class AccreditationReportChild(Document): pass diff --git a/psa/psa_registration/doctype/appoint_student_research/test_appoint_student_research.py b/psa/psa_registration/doctype/accreditation_report_child/test_accreditation_report_child.py similarity index 73% rename from psa/psa_registration/doctype/appoint_student_research/test_appoint_student_research.py rename to psa/psa_registration/doctype/accreditation_report_child/test_accreditation_report_child.py index 3b49786..f34b107 100644 --- a/psa/psa_registration/doctype/appoint_student_research/test_appoint_student_research.py +++ b/psa/psa_registration/doctype/accreditation_report_child/test_accreditation_report_child.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestAppointStudentResearch(FrappeTestCase): +class TestAccreditationReportChild(FrappeTestCase): pass diff --git a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.json b/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.json deleted file mode 100644 index 71a3cb2..0000000 --- a/psa/psa_registration/doctype/appoint_student_research/appoint_student_research.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "actions": [ - { - "action": "research-proposal-defense", - "action_type": "Route", - "label": "research-proposal-defense" - } - ], - "allow_rename": 1, - "autoname": "naming_series:", - "creation": "2024-07-16 03:24:04.892607", - "default_view": "List", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "naming_series", - "student", - "program__enrollment", - "column_break_robp", - "disable", - "status", - "section_break_qcdd", - "research_title_english", - "column_break_hrcl", - "research_title_arabic", - "section_break_wpxd", - "reference_doctype", - "column_break_phey", - "document_name", - "section_break_rnvd", - "pervious_proposal", - "section_break_aqlh", - "supervisor_details_html", - "amended_from" - ], - "fields": [ - { - "fieldname": "naming_series", - "fieldtype": "Select", - "hidden": 1, - "in_list_view": 1, - "label": "Naming Series", - "options": "PSA-Std-Res-.YY.-.MM.-.####" - }, - { - "fieldname": "student", - "fieldtype": "Link", - "label": "Student", - "options": "Student" - }, - { - "fetch_from": ".", - "fieldname": "program__enrollment", - "fieldtype": "Data", - "label": "Program Enrollment" - }, - { - "fieldname": "column_break_robp", - "fieldtype": "Column Break" - }, - { - "default": "0", - "fieldname": "disable", - "fieldtype": "Check", - "label": "Disable" - }, - { - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "options": "\nActive\nChanged\nFinished", - "search_index": 1 - }, - { - "fieldname": "section_break_qcdd", - "fieldtype": "Section Break" - }, - { - "fieldname": "research_title_english", - "fieldtype": "Small Text", - "label": "Research Title English" - }, - { - "fieldname": "column_break_hrcl", - "fieldtype": "Column Break" - }, - { - "fieldname": "research_title_arabic", - "fieldtype": "Small Text", - "label": "Research Title Arabic" - }, - { - "fieldname": "section_break_wpxd", - "fieldtype": "Section Break" - }, - { - "fieldname": "reference_doctype", - "fieldtype": "Link", - "label": "Reference Doctype", - "options": "DocType" - }, - { - "fieldname": "column_break_phey", - "fieldtype": "Column Break" - }, - { - "fieldname": "document_name", - "fieldtype": "Dynamic Link", - "label": "Document Name", - "options": "reference_doctype" - }, - { - "fieldname": "section_break_rnvd", - "fieldtype": "Section Break" - }, - { - "fieldname": "pervious_proposal", - "fieldtype": "Link", - "label": "Pervious Proposal", - "options": "Appoint Student Research" - }, - { - "fieldname": "section_break_aqlh", - "fieldtype": "Section Break" - }, - { - "fieldname": "supervisor_details_html", - "fieldtype": "HTML", - "label": "Supervisor Details html" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Appoint Student Research", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Appoint Student Research", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - } - ], - "index_web_pages_for_search": 1, - "is_submittable": 1, - "links": [], - "modified": "2024-07-16 03:26:47.696593", - "modified_by": "Administrator", - "module": "PSA Registration", - "name": "Appoint Student Research", - "naming_rule": "By \"Naming Series\" field", - "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": [] -} \ No newline at end of file diff --git a/psa/psa_registration/doctype/appoint_supervisor_and_defense/__init__.py b/psa/psa_registration/doctype/appoint_supervisor_and_defense/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.js b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.js new file mode 100644 index 0000000..6228d49 --- /dev/null +++ b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.js @@ -0,0 +1,74 @@ +// Copyright (c) 2024, Sana'a university and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Appoint Supervisor and Defense", { + onload(frm){ + // Fetch data from the Doctype + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student", + fields: ["name"], + filters: { + user_id:frappe.session.user_email + } + }, + callback: function(r) { + frm.set_value('student', r.message[0].name); + + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["program"], + filters: { + student:r.message[0].name, + status:"Continued" + } + }, + callback: function(s) { + frm.set_value('program_enrollment', s.message[0].program); + + + } + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Supervisor", + fields: ["supervisor_name"], + filters: { + student:r.message[0].name, + status:"Active" + } + }, + callback: function(s) { + frm.set_value('supervisor', s.message[0].supervisor_name); + + + } + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Research", + fields: ["research_title_arabic","research_title_english"], + filters: { + student:r.message[0].name, + status:"Active" + } + }, + callback: function(s) { + frm.set_value('research_title_english', s.message[0].research_title_english); + frm.set_value('research_title_arabic', s.message[0].research_title_arabic); + + } + }); + } + }); + } + + + }); + + diff --git a/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.json b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.json new file mode 100644 index 0000000..87b2f89 --- /dev/null +++ b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.json @@ -0,0 +1,101 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "naming_series:", + "creation": "2024-08-02 03:00:59.622302", + "default_view": "List", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "naming_series", + "student", + "column_break_noae", + "program_enrollment", + "supervisor", + "section_break_zaej", + "research_title_english", + "column_break_kcii", + "research_title_arabic", + "research_proposal" + ], + "fields": [ + { + "fieldname": "naming_series", + "fieldtype": "Select", + "hidden": 1, + "label": "Naming series", + "options": "REQ-." + }, + { + "fieldname": "student", + "fieldtype": "Link", + "label": "Student", + "options": "Student" + }, + { + "fieldname": "column_break_noae", + "fieldtype": "Column Break" + }, + { + "fieldname": "program_enrollment", + "fieldtype": "Link", + "label": "Program Enrollment", + "options": "Program Enrollment" + }, + { + "fieldname": "supervisor", + "fieldtype": "Data", + "label": "Supervisor" + }, + { + "fieldname": "section_break_zaej", + "fieldtype": "Section Break" + }, + { + "fetch_from": "student.search_title_english", + "fieldname": "research_title_english", + "fieldtype": "Small Text", + "label": "Research Title English" + }, + { + "fieldname": "column_break_kcii", + "fieldtype": "Column Break" + }, + { + "fetch_from": "student.search_title_arabic", + "fieldname": "research_title_arabic", + "fieldtype": "Small Text", + "label": "Research Title Arabic" + }, + { + "fieldname": "research_proposal", + "fieldtype": "Attach", + "label": "Research Proposal" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-02 03:01:31.738477", + "modified_by": "Administrator", + "module": "PSA Registration", + "name": "Appoint Supervisor and Defense", + "naming_rule": "By \"Naming Series\" field", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.py b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.py new file mode 100644 index 0000000..4246e99 --- /dev/null +++ b/psa/psa_registration/doctype/appoint_supervisor_and_defense/appoint_supervisor_and_defense.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Sana'a university and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class AppointSupervisorandDefense(Document): + pass diff --git a/psa/psa_registration/doctype/appoint_supervisor_and_defense/test_appoint_supervisor_and_defense.py b/psa/psa_registration/doctype/appoint_supervisor_and_defense/test_appoint_supervisor_and_defense.py new file mode 100644 index 0000000..d738552 --- /dev/null +++ b/psa/psa_registration/doctype/appoint_supervisor_and_defense/test_appoint_supervisor_and_defense.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Sana'a university and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestAppointSupervisorandDefense(FrappeTestCase): + pass diff --git a/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.js b/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.js index 6bee9db..cdd2189 100644 --- a/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.js +++ b/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.js @@ -10,58 +10,66 @@ frappe.ui.form.on("Initial Research Defense", { // Fetch data from the Doctype - onload: function(frm) { - frappe.call({ - method: 'psa.psa_registration.doctype.student_research.student_research.get_temporary_data', - callback: function(response) { - let data = response.message; - console.log("Received data from server:", data); // Debug statement - - // Set the values in the new form - frm.set_value('research_title_english', data.research_title_english); - frm.set_value('research_title_arabic', data.research_title_arabic); - - // Refresh the fields to show the updated values - frm.refresh_field('research_title_english'); - frm.refresh_field('research_title_arabic'); - } - }); - + student: function(frm) { + + var student = frm.doc.student + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:student, + status:"Continued" + } + }, + callback: function(p) { + frm.set_value('program_enrollment', p.message[0].name); + + + } + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Supervisor", + fields: ["supervisor_name"], + filters: { + student:student, + status:"Active", + type:"Main Supervisor" + } + }, + callback: function(s) { + frm.set_value('supervisor', s.message[0].supervisor_name); + + + }, + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Research", + fields: ["research_title_arabic","research_title_english"], + filters: { + student:student, + status:"Active" + } + }, + callback: function(s) { + frm.set_value('research_title_english', s.message[0].research_title_english); + frm.set_value('research_title_arabic', s.message[0].research_title_arabic); + + } + }); + + - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Student", - fields: ["name"], - filters: { - user_id:frappe.session.user_email - } - }, - callback: function(r) { - frm.set_value('student', r.message[0].name); - - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Program Enrollment", - fields: ["program"], - filters: { - student:r.message[0].name, - status:"Active" - } - }, - callback: function(s) { - frm.set_value('program_enrollment', s.message[0].program); - - - } - }); - } - }); + } }); diff --git a/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.json b/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.json index 7bc5938..872c3c8 100644 --- a/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.json +++ b/psa/psa_registration/doctype/initial_research_defense/initial_research_defense.json @@ -17,14 +17,16 @@ "column_break_kcii", "research_title_arabic", "research_proposal", - "\u0644\u062c\u0646\u0629_\u0627\u0644\u0645\u0646\u0627\u0642\u0629_ta", + "discussion_committee_tab", "committee_president_section", "committee_president", "discussion_place", "type_committee", + "department_council_minutes_number", "column_break_gdzn", "discussion_date", "discussion_time", + "department_council_date", "committee_members_section", "committee_members" ], @@ -41,7 +43,7 @@ "fieldtype": "Link", "label": "Student", "options": "Student", - "read_only": 1 + "reqd": 1 }, { "fieldname": "column_break_noae", @@ -52,7 +54,9 @@ "fieldname": "supervisor", "fieldtype": "Link", "label": "Supervisor", - "options": "Student Main Supervisor" + "options": "Student Supervisor", + "read_only": 1, + "reqd": 1 }, { "fieldname": "section_break_zaej", @@ -75,16 +79,11 @@ "label": "Research Title Arabic" }, { - "fetch_from": "student.research_proposal", + "fetch_from": ".research_proposal", "fieldname": "research_proposal", "fieldtype": "Attach", "label": "Research Proposal" }, - { - "fieldname": "\u0644\u062c\u0646\u0629_\u0627\u0644\u0645\u0646\u0627\u0642\u0629_ta", - "fieldtype": "Tab Break", - "label": "Discussion Committee" - }, { "fieldname": "committee_president_section", "fieldtype": "Section Break" @@ -122,9 +121,11 @@ }, { "fieldname": "program_enrollment", - "fieldtype": "Data", + "fieldtype": "Link", "label": "Program Enrollment", - "read_only": 1 + "options": "Program Enrollment", + "read_only": 1, + "reqd": 1 }, { "fieldname": "discussion_place", @@ -140,11 +141,26 @@ "label": "Type Committee ", "options": "\nResearch Proposal Defense\nInitial Defense", "reqd": 1 + }, + { + "fieldname": "department_council_date", + "fieldtype": "Date", + "label": "Department Council Date" + }, + { + "fieldname": "discussion_committee_tab", + "fieldtype": "Tab Break", + "label": "Discussion Committee" + }, + { + "fieldname": "department_council_minutes_number", + "fieldtype": "Date", + "label": "Department Council Minutes Number" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-07-16 03:05:01.729695", + "modified": "2024-08-04 01:20:50.447580", "modified_by": "Administrator", "module": "PSA Registration", "name": "Initial Research Defense", diff --git a/psa/psa_registration/doctype/request_a_supervisor_child/request_a_supervisor_child.json b/psa/psa_registration/doctype/request_a_supervisor_child/request_a_supervisor_child.json index ae6a2ea..b213952 100644 --- a/psa/psa_registration/doctype/request_a_supervisor_child/request_a_supervisor_child.json +++ b/psa/psa_registration/doctype/request_a_supervisor_child/request_a_supervisor_child.json @@ -3,6 +3,7 @@ "allow_rename": 1, "creation": "2024-05-05 03:12:59.755405", "doctype": "DocType", + "editable_grid": 1, "engine": "InnoDB", "field_order": [ "faculty", @@ -16,14 +17,18 @@ "fieldtype": "Link", "in_list_view": 1, "label": "Faculty", - "options": "Faculty" + "options": "Faculty", + "reqd": 1 }, { "allow_in_quick_entry": 1, + "fetch_from": "faculty_member.scientific_degree", "fieldname": "academic_degree", "fieldtype": "Data", "in_list_view": 1, - "label": "Academic Degree" + "label": "Academic Degree", + "read_only": 1, + "reqd": 1 }, { "allow_in_quick_entry": 1, @@ -31,13 +36,14 @@ "fieldtype": "Link", "in_list_view": 1, "label": "Faculty Member", - "options": "Faculty Member" + "options": "Faculty Member", + "reqd": 1 } ], "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2024-05-08 12:33:53.539309", + "modified": "2024-08-03 22:44:25.217046", "modified_by": "Administrator", "module": "PSA Registration", "name": "Request A Supervisor child", diff --git a/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.js b/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.js index 1f9576d..f8fa14c 100644 --- a/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.js +++ b/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.js @@ -7,7 +7,7 @@ // }, // }); frappe.ui.form.on('Request Co-Supervisor', { - validate: function(frm) { + validate: function(frm) { var research_title_english = frm.doc.research_title_english; // Replace 'letter' with the actual fieldname in your doctype var isEnglish = /^[A-Za-z\s]+$/.test(research_title_english); // Replace 'letter' with the actual fieldname in your doctype if (!isEnglish) { @@ -27,10 +27,15 @@ frappe.ui.form.on('Request Co-Supervisor', { }); -frappe.ui.form.on("Request Co-Supervisor", "onload", function(frm) { +frappe.ui.form.on("Request Co-Supervisor",{ - - // Fetch data from the Doctype + onload(frm){ + frm.clear_table("supervisors"); + frm.add_child("supervisors"); + frm.add_child("supervisors"); + frm.add_child("supervisors"); + frm.refresh_field("supervisors"); + // Fetch data from the Doctype frappe.call({ method: "frappe.client.get_list", args: { @@ -47,20 +52,42 @@ frappe.ui.form.on("Request Co-Supervisor", "onload", function(frm) { method: "frappe.client.get_list", args: { doctype: "Program Enrollment", - fields: ["program"], + fields: ["name"], + filters: { + student:r.message[0].name, + status:"Continued" + } + }, + callback: function(p) { + frm.set_value('program_enrollment', p.message[0].name); + + + } + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Supervisor", + fields: ["supervisor_name"], filters: { student:r.message[0].name, - status:"Active" + status:"Active", + type:"Main Supervisor" } }, callback: function(s) { - frm.set_value('program_enrollment', s.message[0].program); + frm.set_value('supervisor', s.message[0].supervisor_name); } }); } - }); + } + ); + + } + + }); diff --git a/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.json b/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.json index 363b6ad..fb14dc7 100644 --- a/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.json +++ b/psa/psa_registration/doctype/request_co_supervisor/request_co_supervisor.json @@ -11,13 +11,8 @@ "column_break_xhbm", "program_enrollment", "supervisor", - "section_break_lbre", - "research_title_english", - "search", - "column_break_pign", - "research_title_arabic", "section_break_qtzf", - "table_nxrm" + "supervisors" ], "fields": [ { @@ -45,46 +40,24 @@ }, { "fieldname": "supervisor", - "fieldtype": "Link", + "fieldtype": "Data", "label": "Supervisor", - "options": "Student Main Supervisor" - }, - { - "fieldname": "section_break_lbre", - "fieldtype": "Section Break" - }, - { - "fieldname": "research_title_english", - "fieldtype": "Small Text", - "label": "Research Title English" - }, - { - "fieldname": "search", - "fieldtype": "Text", - "label": "Search" - }, - { - "fieldname": "column_break_pign", - "fieldtype": "Column Break" - }, - { - "fieldname": "research_title_arabic", - "fieldtype": "Small Text", - "label": "Research Title Arabic" + "read_only": 1 }, { "fieldname": "section_break_qtzf", "fieldtype": "Section Break" }, { - "fieldname": "table_nxrm", + "fieldname": "supervisors", "fieldtype": "Table", + "label": "supervisors", "options": "Request A Supervisor child" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-07-13 23:45:02.569046", + "modified": "2024-08-04 00:20:20.192809", "modified_by": "Administrator", "module": "PSA Registration", "name": "Request Co-Supervisor", diff --git a/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.js b/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.js index 515f1e5..32a2784 100644 --- a/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.js +++ b/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.js @@ -6,3 +6,76 @@ // }, // }); + +frappe.ui.form.on("Request for Research Proposal Defense", "onload", function(frm) { + + + // Fetch data from the Doctype + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student", + fields: ["name"], + filters: { + user_id:frappe.session.user_email + } + }, + callback: function(r) { + frm.set_value('student', r.message[0].name); + + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:r.message[0].name, + status:"Continued" + } + }, + callback: function(p) { + frm.set_value('program_enrollment', p.message[0].name); + + + } + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Supervisor", + fields: ["supervisor_name"], + filters: { + student:r.message[0].name, + status:"Active", + type:"Main Supervisor" + } + }, + callback: function(s) { + frm.set_value('supervisor', s.message[0].supervisor_name); + + + }, + }); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student Research", + fields: ["research_title_arabic","research_title_english"], + filters: { + student:r.message[0].name, + status:"Active" + } + }, + callback: function(s) { + frm.set_value('research_title_english', s.message[0].research_title_english); + frm.set_value('research_title_arabic', s.message[0].research_title_arabic); + + } + }); + } + } + ); + }); + + + diff --git a/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.json b/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.json index bfb7234..fdec77c 100644 --- a/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.json +++ b/psa/psa_registration/doctype/request_for_research_proposal_defense/request_for_research_proposal_defense.json @@ -21,21 +21,24 @@ { "fieldname": "student", "fieldtype": "Link", + "in_list_view": 1, "label": "Student", - "options": "Student" + "options": "Student", + "read_only": 1, + "reqd": 1 }, { "fieldname": "column_break_noae", "fieldtype": "Column Break" }, { - "fetch_from": "student.search_title_english", + "fetch_from": ".search_title_english", "fieldname": "research_title_english", "fieldtype": "Small Text", "label": "Research Title English" }, { - "fetch_from": "student.search_title_arabic", + "fetch_from": ".search_title_arabic", "fieldname": "research_title_arabic", "fieldtype": "Small Text", "label": "Research Title Arabic" @@ -43,19 +46,26 @@ { "fieldname": "supervisor", "fieldtype": "Data", - "label": "Supervisor" + "in_list_view": 1, + "label": "Supervisor", + "read_only": 1, + "reqd": 1 }, { "fieldname": "naming_series", "fieldtype": "Select", + "hidden": 1, "label": "Naming series", "options": "REQ-." }, { "fieldname": "program_enrollment", "fieldtype": "Link", + "in_list_view": 1, "label": "Program Enrollment", - "options": "Program Enrollment" + "options": "Program Enrollment", + "read_only": 1, + "reqd": 1 }, { "fieldname": "section_break_zaej", @@ -73,7 +83,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-05-05 18:35:12.893566", + "modified": "2024-08-04 00:51:22.003159", "modified_by": "Administrator", "module": "PSA Registration", "name": "Request for Research Proposal Defense", diff --git a/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.js b/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.js index bc77298..bc87b57 100644 --- a/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.js +++ b/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.js @@ -25,39 +25,48 @@ frappe.ui.form.on('Request Main Supervisor', { // frm.set_value('student_name', frappe.session.user_fullname); // } // }); -frappe.ui.form.on("Request Main Supervisor", "onload", function(frm) { - - - // Fetch data from the Doctype - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Student", - fields: ["name"], - filters: { - user_id:frappe.session.user_email - } - }, - callback: function(r) { - frm.set_value('student_name', r.message[0].name); +frappe.ui.form.on("Request Main Supervisor", { + onload(frm){ + frm.clear_table("supervisors"); + frm.add_child("supervisors"); + frm.add_child("supervisors"); + frm.add_child("supervisors"); + frm.refresh_field("supervisors"); + + // Fetch data from the Doctype + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Student", + fields: ["name"], + filters: { + user_id:frappe.session.user_email + } + }, + callback: function(r) { + frm.set_value('student_name', r.message[0].name); + + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:r.message[0].name, + status:"Continued" + } + }, + callback: function(s) { + frm.set_value('program_enrollment', s.message[0].name); + - frappe.call({ - method: "frappe.client.get_list", - args: { - doctype: "Program Enrollment", - fields: ["program"], - filters: { - student:r.message[0].name, - status:"Active" } - }, - callback: function(s) { - frm.set_value('program_enrollment', s.message[0].program); - - - } - }); - } - }); + }); + + + } + }); + } + + }); - diff --git a/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.json b/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.json index f9f2b69..e320c69 100644 --- a/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.json +++ b/psa/psa_registration/doctype/request_main_supervisor/request_main_supervisor.json @@ -17,7 +17,7 @@ "column_break_pign", "research_title_arabic", "section_break_qtzf", - "table_nxrm" + "supervisors" ], "fields": [ { @@ -69,17 +69,20 @@ }, { "fieldname": "section_break_qtzf", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "Supervisors" }, { - "fieldname": "table_nxrm", + "fieldname": "supervisors", "fieldtype": "Table", - "options": "Request A Supervisor child" + "label": "Supervisors", + "options": "Request A Supervisor child", + "reqd": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-07-13 23:42:42.643036", + "modified": "2024-08-03 22:45:40.574111", "modified_by": "Administrator", "module": "PSA Registration", "name": "Request Main Supervisor", diff --git a/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.js b/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.js index d7c5437..931535f 100644 --- a/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.js +++ b/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.js @@ -8,53 +8,102 @@ // }); frappe.ui.form.on("Seminar Discussion Committee Membe Report", { student: function(frm) { - frappe.call({ + + frappe.call({ method: "frappe.client.get_list", args: { - doctype: "Seminar Discussion Faculty Member Report", - fields: ["*"], + doctype: "Program Enrollment", + fields: ["name"], filters: { - student:frm.doc.student - + student:frm.doc.student, + status:"Continued" } }, - callback: function(r) { - frm.clear_table("committee_report"); - - // Loop through the data and add to child table - r.message.forEach(function(row) { - var child = frm.add_child("committee_report"); - child.doctor = row.doctor; - child.research_title_english = row.research_title_english; - child.research_title_arabic = row.research_title_arabic; - child.description = row.description; - child.statues = row.statues; + callback: function(s) { + frm.set_value('program_enrollment', s.message[0].name); + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Seminar Discussion Faculty Member Report", + fields: ["*"], + filters: { + student:frm.doc.student, + program_enrollment:s.message[0].name + + } + }, + callback: function(r) { + frm.clear_table("committee_report"); + + // Loop through the data and add to child table + r.message.forEach(function(row) { + var child = frm.add_child("committee_report"); + child.doctor = row.doctor; + child.research_title_english = row.research_title_english; + child.research_title_arabic = row.research_title_arabic; + child.description = row.description; + child.statues = row.statues; + + }); + + // Refresh the form to reflect changes + frm.refresh_field("committee_report"); + + } }); - - // Refresh the form to reflect changes - frm.refresh_field("committee_report"); - + } }); frappe.call({ method: "frappe.client.get_list", args: { - doctype: "Program Enrollment", - fields: ["program"], + doctype: "Student Supervisor", + fields: ["supervisor_name"], filters: { student:frm.doc.student, - status:"Active" + status:"Active", + type:"Main Supervisor" } }, callback: function(s) { - frm.set_value('program_enrollment', s.message[0].program); + frm.set_value('supervisor', s.message[0].supervisor_name); - } + }, }); + } +}); + +frappe.ui.form.on("Seminar Discussion Committee Membe Report", { + onload: function(frm) { + // Fetch the user's Employee record using their email ID + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Employee", + filters: { + user_id: frappe.session.user + }, + fields: ["first_name"] + }, + callback: function(r) { + if (r.message && r.message.length > 0) { + // Set the 'doctor' field with the fetched user's first name + frm.set_value('doctor', r.message[0].first_name); + } else { + // Handle case where user is not found + frappe.msgprint(__('No Employee record found for the current user.')); + } + }, + error: function(error) { + // Handle any errors during the call + frappe.msgprint(__('Error fetching user data: ' + error.message)); + } + }); + } }); \ No newline at end of file diff --git a/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.json b/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.json index bf04beb..cf765e2 100644 --- a/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.json +++ b/psa/psa_registration/doctype/seminar_discussion_committee_membe_report/seminar_discussion_committee_membe_report.json @@ -9,6 +9,7 @@ "program_enrollment", "column_break_ktid", "supervisor", + "doctor", "section_break_acsd", "committee_report" ], @@ -43,11 +44,16 @@ "fieldtype": "Table", "label": "Committee Report", "options": "Discussion Committee Seminar Faculty Member" + }, + { + "fieldname": "doctor", + "fieldtype": "Data", + "label": "Doctor" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-07-16 04:03:58.641207", + "modified": "2024-08-04 01:48:59.993438", "modified_by": "Administrator", "module": "PSA Registration", "name": "Seminar Discussion Committee Membe Report", diff --git a/psa/psa_registration/doctype/seminar_discussion_faculty_member_report/seminar_discussion_faculty_member_report.js b/psa/psa_registration/doctype/seminar_discussion_faculty_member_report/seminar_discussion_faculty_member_report.js index ddaeda9..1f4e5ee 100644 --- a/psa/psa_registration/doctype/seminar_discussion_faculty_member_report/seminar_discussion_faculty_member_report.js +++ b/psa/psa_registration/doctype/seminar_discussion_faculty_member_report/seminar_discussion_faculty_member_report.js @@ -28,8 +28,50 @@ frappe.ui.form.on('Seminar Discussion Faculty Member Report', { } }); -frappe.ui.form.on('Seminar Discussion Faculty Member Report', { - onload: function(frm) { - frm.set_value('doctor', frappe.session.user_fullname); - } -}); +frappe.ui.form.on("Seminar Discussion Faculty Member Report", { + onload: function(frm) { + // Fetch the user's Employee record using their email ID + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Employee", + filters: { + user_id: frappe.session.user + }, + fields: ["first_name"] + }, + callback: function(r) { + if (r.message && r.message.length > 0) { + // Set the 'doctor' field with the fetched user's first name + frm.set_value('doctor', r.message[0].first_name); + } else { + // Handle case where user is not found + frappe.msgprint(__('No Employee record found for the current user.')); + } + }, + error: function(error) { + // Handle any errors during the call + frappe.msgprint(__('Error fetching user data: ' + error.message)); + } + }); + + }, + student:function(frm){ + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:frm.doc.student, + status:"Continued" + } + }, + callback: function(s) { + frm.set_value('program_enrollment', s.message[0].name); + + + } + }); + } + }); \ No newline at end of file diff --git a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.json b/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.json deleted file mode 100644 index 44f4873..0000000 --- a/psa/psa_registration/doctype/student_co_supervisor/student_co_supervisor.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "actions": [], - "allow_rename": 1, - "autoname": "naming_series:", - "creation": "2024-07-08 18:26:09.991818", - "default_view": "List", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "disable", - "naming_series", - "student", - "program_enrollment", - "column_break_twux", - "supervisor", - "type", - "status", - "section_break_apcp", - "reference_doctype", - "column_break_cdqb", - "document_name", - "section_break_fppk", - "pervious_supervisor", - "section_break_gbik", - "research_details_html" - ], - "fields": [ - { - "default": "0", - "fieldname": "disable", - "fieldtype": "Check", - "label": "Disable" - }, - { - "fieldname": "naming_series", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Naming Series", - "options": "PSA-Std-Sup-.YY.-.MM.-.####", - "reqd": 1 - }, - { - "fieldname": "student", - "fieldtype": "Link", - "label": "Student", - "options": "Student" - }, - { - "fieldname": "program_enrollment", - "fieldtype": "Link", - "label": "Program Enrollment", - "options": "Program Enrollment" - }, - { - "fieldname": "column_break_twux", - "fieldtype": "Column Break" - }, - { - "fieldname": "supervisor", - "fieldtype": "Link", - "label": "Supervisor", - "options": "Faculty Member" - }, - { - "fieldname": "type", - "fieldtype": "Select", - "label": "Type", - "options": "\nMain Supervisor\nCo-Supervisor" - }, - { - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "options": "\nActive\nChanged\nFinished" - }, - { - "fieldname": "section_break_apcp", - "fieldtype": "Section Break" - }, - { - "fieldname": "reference_doctype", - "fieldtype": "Link", - "label": "Reference Doctype", - "options": "DocType" - }, - { - "fieldname": "column_break_cdqb", - "fieldtype": "Column Break" - }, - { - "fieldname": "document_name", - "fieldtype": "Dynamic Link", - "label": "Document Name", - "options": "reference_doctype" - }, - { - "fieldname": "section_break_fppk", - "fieldtype": "Section Break" - }, - { - "fieldname": "pervious_supervisor", - "fieldtype": "Link", - "label": "Pervious Supervisor", - "options": "Student Main Supervisor" - }, - { - "fieldname": "section_break_gbik", - "fieldtype": "Section Break" - }, - { - "fieldname": "research_details_html", - "fieldtype": "HTML", - "label": "Research Details html" - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-07-08 18:27:15.792526", - "modified_by": "Administrator", - "module": "PSA Registration", - "name": "Student Co-Supervisor", - "naming_rule": "By \"Naming Series\" field", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "modified", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file diff --git a/psa/psa_registration/doctype/student_research/student_research.js b/psa/psa_registration/doctype/student_research/student_research.js index d3d98d5..238d583 100644 --- a/psa/psa_registration/doctype/student_research/student_research.js +++ b/psa/psa_registration/doctype/student_research/student_research.js @@ -1,8 +1,26 @@ // Copyright (c) 2024, Sana'a university and contributors // For license information, please see license.txt -// frappe.ui.form.on("Student Research", { -// refresh(frm) { - -// }, -// }); +frappe.ui.form.on("Student Research" , { + + student:function(frm){ + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:frm.doc.student, + status:"Continued" + } + }, + callback: function(r) { + frm.set_value('program_enrollment', r.message[0].name); + + + } + }); + } + // Fetch data from the Doctype + + }); \ No newline at end of file diff --git a/psa/psa_registration/doctype/student_research/student_research.json b/psa/psa_registration/doctype/student_research/student_research.json index 847fa3b..4224b07 100644 --- a/psa/psa_registration/doctype/student_research/student_research.json +++ b/psa/psa_registration/doctype/student_research/student_research.json @@ -13,8 +13,8 @@ "status", "section_break_styg", "student", - "program_enrollment", "column_break_robp", + "program_enrollment", "section_break_qcdd", "research_title_arabic", "column_break_hrcl", @@ -106,10 +106,10 @@ { "fieldname": "naming_series", "fieldtype": "Select", + "hidden": 1, "in_list_view": 1, "label": "Naming Series", - "options": "PSA-Std-Res-.YY.-.MM.-.####", - "reqd": 1 + "options": "PSA-Std-Res-.YY.-.MM.-.####" }, { "fieldname": "section_break_qcdd", @@ -135,6 +135,7 @@ "fieldtype": "Link", "label": "Program Enrollment", "options": "Program Enrollment", + "read_only": 1, "reqd": 1 }, { @@ -183,7 +184,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-07-27 02:29:02.266197", + "modified": "2024-08-03 23:18:03.930141", "modified_by": "Administrator", "module": "PSA Registration", "name": "Student Research", @@ -201,6 +202,18 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Department Head", + "share": 1, + "write": 1 } ], "sort_field": "modified", diff --git a/psa/psa_registration/doctype/student_research/student_research.py b/psa/psa_registration/doctype/student_research/student_research.py index 99125ca..ec5d030 100644 --- a/psa/psa_registration/doctype/student_research/student_research.py +++ b/psa/psa_registration/doctype/student_research/student_research.py @@ -6,8 +6,9 @@ class StudentResearch(Document): - def on_submit(self): - sup_record = frappe.get_doc('Student Research', self.pervious_proposal) - sup_record.status = 'Changed' - sup_record.enabled = 0 - sup_record.save() + # def on_submit(self): + # sup_record = frappe.get_doc('Student Research', self.pervious_proposal) + # sup_record.status = 'Changed' + # sup_record.enabled = 0 + # sup_record.save() + pass \ No newline at end of file diff --git a/psa/psa_registration/doctype/student_supervisor/student_supervisor.js b/psa/psa_registration/doctype/student_supervisor/student_supervisor.js index 2992b06..2b85b23 100644 --- a/psa/psa_registration/doctype/student_supervisor/student_supervisor.js +++ b/psa/psa_registration/doctype/student_supervisor/student_supervisor.js @@ -1,8 +1,49 @@ // Copyright (c) 2024, Sana'a university and contributors // For license information, please see license.txt -// frappe.ui.form.on("Student Supervisor", { -// refresh(frm) { - -// }, -// }); +frappe.ui.form.on("Student Supervisor", { + refresh(frm){ + + }, + student:function(frm) { + + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Program Enrollment", + fields: ["name"], + filters: { + student:frm.doc.student, + status:"Continued" + } + }, + callback: function(r) { + frm.set_value('program_enrollment', r.message[0].name); + + + } + }); + +}, + // student:function(frm) { + // var student = frm.doc.student; + // if(student){ + // frappe.call({ + // method: "frappe.client.get_list", + // args: { + // doctype: "Program Enrollment", + // fields: ["name"], + // filters: { + // student:student, + // status:'Continued' + // } + // }, + // callback: function(r) { + + // frm.set_value('program_enrollment', r.message[0].name); + + // } + // }); + // } + // }, +}); diff --git a/psa/psa_registration/doctype/student_supervisor/student_supervisor.json b/psa/psa_registration/doctype/student_supervisor/student_supervisor.json index 29b99ad..bfcd137 100644 --- a/psa/psa_registration/doctype/student_supervisor/student_supervisor.json +++ b/psa/psa_registration/doctype/student_supervisor/student_supervisor.json @@ -13,8 +13,8 @@ "status", "section_break_jhrk", "student", - "program_enrollment", "column_break_twux", + "program_enrollment", "section_break_cssm", "supervisor", "supervisor_name", @@ -65,6 +65,7 @@ "fieldtype": "Link", "label": "Program Enrollment", "options": "Program Enrollment", + "read_only": 1, "reqd": 1 }, { @@ -182,7 +183,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-07-27 02:24:01.141853", + "modified": "2024-08-02 18:20:32.463409", "modified_by": "Administrator", "module": "PSA Registration", "name": "Student Supervisor", diff --git a/psa/psa_registration/doctype/summary_accreditation_report/__init__.py b/psa/psa_registration/doctype/summary_accreditation_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.js b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.js new file mode 100644 index 0000000..7a1389b --- /dev/null +++ b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.js @@ -0,0 +1,38 @@ +// Copyright (c) 2024, Sana'a university and contributors +// For license information, please see license.txt + +frappe.ui.form.on("summary Accreditation Report", { + appoint_supervisor_and_defense: function(frm) { + frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Accreditation Report", + fields: ["*"], + filters: { + appoint_supervisor_and_defense:frm.doc.appoint_supervisor_and_defense + + } + }, + callback: function(r) { + frm.clear_table("accreditation_report"); + + // Loop through the data and add to child table + r.message.forEach(function(row) { + var child = frm.add_child("accreditation_report"); + child.council = row.council; + child.record_number = row.record_number; + child.decision = row.decision; + child.description = row.description; + + }); + + // Refresh the form to reflect changes + frm.refresh_field("accreditation_report"); + + + } + }); + + + } +}); diff --git a/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.json b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.json new file mode 100644 index 0000000..44f17e2 --- /dev/null +++ b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.json @@ -0,0 +1,109 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-08-03 22:25:32.298701", + "default_view": "List", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "appoint_supervisor_and_defense", + "program_enrollment", + "research_title_english", + "research_proposal", + "column_break_bmgj", + "student", + "supervisor", + "research_title_arabic", + "accreditation_report_section", + "accreditation_report" + ], + "fields": [ + { + "fieldname": "appoint_supervisor_and_defense", + "fieldtype": "Link", + "label": "Appoint Supervisor and Defense", + "options": "Appoint Supervisor and Defense" + }, + { + "fetch_from": "appoint_supervisor_and_defense.program_enrollment", + "fieldname": "program_enrollment", + "fieldtype": "Data", + "label": "Program Enrollment", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_title_english", + "fieldname": "research_title_english", + "fieldtype": "Data", + "label": "Research Title English", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_proposal", + "fieldname": "research_proposal", + "fieldtype": "Attach", + "label": " Research Proposal", + "read_only": 1 + }, + { + "fieldname": "column_break_bmgj", + "fieldtype": "Column Break" + }, + { + "fetch_from": "appoint_supervisor_and_defense.student", + "fieldname": "student", + "fieldtype": "Data", + "label": "Student", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.supervisor", + "fieldname": "supervisor", + "fieldtype": "Data", + "label": "Supervisor", + "read_only": 1 + }, + { + "fetch_from": "appoint_supervisor_and_defense.research_title_arabic", + "fieldname": "research_title_arabic", + "fieldtype": "Data", + "label": "Research Title Arabic", + "read_only": 1 + }, + { + "fieldname": "accreditation_report_section", + "fieldtype": "Section Break", + "label": "Accreditation Report" + }, + { + "fieldname": "accreditation_report", + "fieldtype": "Table", + "label": "Accreditation Report", + "options": "Accreditation Report Child" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-08-03 22:33:59.530252", + "modified_by": "Administrator", + "module": "PSA Registration", + "name": "summary Accreditation Report", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.py b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.py new file mode 100644 index 0000000..ee4238f --- /dev/null +++ b/psa/psa_registration/doctype/summary_accreditation_report/summary_accreditation_report.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Sana'a university and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class summaryAccreditationReport(Document): + pass diff --git a/psa/psa_registration/doctype/summary_accreditation_report/test_summary_accreditation_report.py b/psa/psa_registration/doctype/summary_accreditation_report/test_summary_accreditation_report.py new file mode 100644 index 0000000..0c844da --- /dev/null +++ b/psa/psa_registration/doctype/summary_accreditation_report/test_summary_accreditation_report.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Sana'a university and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestsummaryAccreditationReport(FrappeTestCase): + pass