-
Notifications
You must be signed in to change notification settings - Fork 1
TASK-2026-00448,TASK-2026-00449,TASK-2026-00450:Room Management, Communication Log, and Meeting Room Booking Implementation. #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
23 changes: 23 additions & 0 deletions
23
gams/general_administration_management_system/doctype/communication_log/communication_log.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright (c) 2026, efeone and contributors | ||
| // For license information, please see license.txt | ||
|
|
||
| frappe.ui.form.on('Communication Log', { | ||
| onload: function(frm) { | ||
| set_logged_in_employee(frm); | ||
| } | ||
| }); | ||
|
|
||
| /* | ||
| * Populate the "Logged By" field with the Employee linked to the current session user. | ||
| */ | ||
| function set_logged_in_employee(frm) { | ||
| if (!frm.doc.logged_by) { | ||
| frappe.db.get_value('Employee', { | ||
| user_id: frappe.session.user | ||
| }, 'name').then(r => { | ||
| if (r.message && r.message.name) { | ||
| frm.set_value('logged_by', r.message.name); | ||
| } | ||
| }); | ||
| } | ||
| } |
121 changes: 121 additions & 0 deletions
121
...general_administration_management_system/doctype/communication_log/communication_log.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| { | ||
| "actions": [], | ||
| "allow_rename": 1, | ||
| "autoname": "CML-.YYYY.-.####", | ||
| "creation": "2026-04-08 13:44:29.225107", | ||
| "doctype": "DocType", | ||
| "engine": "InnoDB", | ||
| "field_order": [ | ||
| "communication_type", | ||
| "subject", | ||
| "from_party", | ||
| "to_party", | ||
| "column_break_stha", | ||
| "communication_date", | ||
| "logged_by", | ||
| "reference_doctype", | ||
| "reference_name", | ||
| "attachments", | ||
| "section_break_sqts", | ||
| "remarks" | ||
| ], | ||
| "fields": [ | ||
| { | ||
| "fieldname": "communication_type", | ||
| "fieldtype": "Select", | ||
| "label": "Communication Type", | ||
| "options": "Letter\nNotice\nCircular\nEmail\nMemo" | ||
| }, | ||
| { | ||
| "fieldname": "subject", | ||
| "fieldtype": "Data", | ||
| "in_list_view": 1, | ||
| "label": "Subject", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "from_party", | ||
| "fieldtype": "Data", | ||
| "label": "From Party", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "to_party", | ||
| "fieldtype": "Data", | ||
| "label": "To Party", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "column_break_stha", | ||
| "fieldtype": "Column Break" | ||
| }, | ||
| { | ||
| "default": "Today", | ||
| "fieldname": "communication_date", | ||
| "fieldtype": "Date", | ||
| "label": "Communication Date", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "logged_by", | ||
| "fieldtype": "Link", | ||
| "label": "Logged By", | ||
| "options": "Employee", | ||
| "read_only": 1 | ||
| }, | ||
| { | ||
| "fieldname": "reference_doctype", | ||
| "fieldtype": "Link", | ||
| "label": "Reference Doctype", | ||
| "options": "DocType" | ||
| }, | ||
| { | ||
| "fieldname": "reference_name", | ||
| "fieldtype": "Dynamic Link", | ||
| "label": "Reference Name", | ||
| "options": "reference_doctype" | ||
| }, | ||
| { | ||
| "fieldname": "attachments", | ||
| "fieldtype": "Attach", | ||
| "label": "Attachments" | ||
| }, | ||
| { | ||
| "fieldname": "section_break_sqts", | ||
| "fieldtype": "Section Break" | ||
| }, | ||
| { | ||
| "fieldname": "remarks", | ||
| "fieldtype": "Small Text", | ||
| "label": "Remarks" | ||
| } | ||
| ], | ||
| "grid_page_length": 50, | ||
| "index_web_pages_for_search": 1, | ||
| "links": [], | ||
| "modified": "2026-04-08 13:44:29.225107", | ||
| "modified_by": "admin@example.com", | ||
| "module": "General Administration Management System", | ||
| "name": "Communication Log", | ||
| "naming_rule": "Expression", | ||
| "owner": "admin@example.com", | ||
| "permissions": [ | ||
| { | ||
| "create": 1, | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "System Manager", | ||
| "share": 1, | ||
| "write": 1 | ||
| } | ||
| ], | ||
| "row_format": "Dynamic", | ||
| "rows_threshold_for_grid_search": 20, | ||
| "sort_field": "modified", | ||
| "sort_order": "DESC", | ||
| "states": [] | ||
| } |
9 changes: 9 additions & 0 deletions
9
gams/general_administration_management_system/doctype/communication_log/communication_log.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright (c) 2026, efeone and contributors | ||
| # For license information, please see license.txt | ||
|
|
||
| # import frappe | ||
| from frappe.model.document import Document | ||
|
|
||
|
|
||
| class CommunicationLog(Document): | ||
| pass |
9 changes: 9 additions & 0 deletions
9
...eral_administration_management_system/doctype/communication_log/test_communication_log.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright (c) 2026, efeone and Contributors | ||
| # See license.txt | ||
|
|
||
| # import frappe | ||
| from frappe.tests.utils import FrappeTestCase | ||
|
|
||
|
|
||
| class TestCommunicationLog(FrappeTestCase): | ||
| pass |
Empty file.
50 changes: 50 additions & 0 deletions
50
...ral_administration_management_system/doctype/meeting_room_booking/meeting_room_booking.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Copyright (c) 2026, efeone and contributors | ||
| // For license information, please see license.txt | ||
|
|
||
| frappe.ui.form.on('Meeting Room Booking', { | ||
| onload: function(frm) { | ||
| set_meeting_room_filter(frm); | ||
| set_logged_in_employee(frm); | ||
| } | ||
| }); | ||
|
|
||
| /** | ||
| * Ensures only rooms with status = "Active" | ||
| * are available for selection | ||
| */ | ||
| function set_meeting_room_filter(frm) { | ||
| frm.set_query('meeting_room', function() { | ||
| return { | ||
| filters: { | ||
| status: 'Active' | ||
| } | ||
| }; | ||
| }); | ||
| } | ||
|
|
||
| /* | ||
| * Populate the "booked_by" field with the Employee linked to the current session user. | ||
| */ | ||
| function set_logged_in_employee(frm) { | ||
| if (!frm.doc.booked_by) { | ||
|
|
||
| // Get current logged-in user | ||
| const user = frappe.session.user; | ||
|
|
||
| if (!user) { | ||
| console.log("Session user not found"); | ||
| return; | ||
| } | ||
|
|
||
| // Fetch Employee linked to user | ||
| frappe.db.get_value('Employee', { | ||
| user_id: user | ||
| }, 'name').then(r => { | ||
| if (r.message && r.message.name) { | ||
| frm.set_value('booked_by', r.message.name); | ||
| } else { | ||
| frappe.msgprint("No Employee linked to this user"); | ||
| } | ||
| }); | ||
| } | ||
| } |
123 changes: 123 additions & 0 deletions
123
...l_administration_management_system/doctype/meeting_room_booking/meeting_room_booking.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| { | ||
| "actions": [], | ||
| "allow_rename": 1, | ||
| "autoname": "RBK-.YYYY.-.####", | ||
| "creation": "2026-04-08 13:43:45.894498", | ||
| "doctype": "DocType", | ||
| "engine": "InnoDB", | ||
| "field_order": [ | ||
| "meeting_room", | ||
| "booked_by", | ||
| "employee_name", | ||
| "column_break_xgfu", | ||
| "booking_date", | ||
| "from_time", | ||
| "to_time", | ||
| "section_break_tmdv", | ||
| "description", | ||
| "status", | ||
| "section_break_fwch", | ||
| "attendees" | ||
| ], | ||
| "fields": [ | ||
| { | ||
| "fieldname": "meeting_room", | ||
| "fieldtype": "Link", | ||
| "label": "Meeting Room", | ||
| "options": "Room", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "booked_by", | ||
| "fieldtype": "Link", | ||
| "label": "Booked By", | ||
| "options": "Employee", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fetch_from": "booked_by.employee_name", | ||
| "fieldname": "employee_name", | ||
| "fieldtype": "Data", | ||
| "label": "Employee Name", | ||
| "read_only": 1 | ||
| }, | ||
| { | ||
| "fieldname": "column_break_xgfu", | ||
| "fieldtype": "Column Break" | ||
| }, | ||
| { | ||
| "default": "Today", | ||
| "fieldname": "booking_date", | ||
| "fieldtype": "Date", | ||
| "label": "Booking Date" | ||
| }, | ||
| { | ||
| "fieldname": "from_time", | ||
| "fieldtype": "Time", | ||
| "in_list_view": 1, | ||
| "label": "From Time", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "to_time", | ||
| "fieldtype": "Time", | ||
| "in_list_view": 1, | ||
| "label": "To Time", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "section_break_tmdv", | ||
| "fieldtype": "Section Break" | ||
| }, | ||
| { | ||
| "fieldname": "description", | ||
| "fieldtype": "Small Text", | ||
| "label": "Description", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "status", | ||
| "fieldtype": "Select", | ||
| "label": "Status", | ||
| "options": "Pending\nApproved\nRejected\nCancelled" | ||
| }, | ||
| { | ||
| "fieldname": "section_break_fwch", | ||
| "fieldtype": "Section Break" | ||
| }, | ||
| { | ||
| "fieldname": "attendees", | ||
| "fieldtype": "Table", | ||
| "label": "Attendees", | ||
| "options": "Resource Booking Attendee" | ||
| } | ||
| ], | ||
| "grid_page_length": 50, | ||
| "index_web_pages_for_search": 1, | ||
| "links": [], | ||
| "modified": "2026-04-08 13:43:45.894498", | ||
| "modified_by": "admin@example.com", | ||
| "module": "General Administration Management System", | ||
| "name": "Meeting Room Booking", | ||
| "naming_rule": "Expression", | ||
| "owner": "admin@example.com", | ||
| "permissions": [ | ||
| { | ||
| "create": 1, | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "System Manager", | ||
| "share": 1, | ||
| "write": 1 | ||
| } | ||
| ], | ||
| "row_format": "Dynamic", | ||
| "rows_threshold_for_grid_search": 20, | ||
| "sort_field": "modified", | ||
| "sort_order": "DESC", | ||
| "states": [] | ||
| } |
44 changes: 44 additions & 0 deletions
44
...ral_administration_management_system/doctype/meeting_room_booking/meeting_room_booking.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Copyright (c) 2026, efeone and contributors | ||
| # For license information, please see license.txt | ||
|
|
||
| import frappe | ||
| from frappe.model.document import Document | ||
| from frappe.utils import getdate, nowdate, get_time | ||
|
|
||
| class MeetingRoomBooking(Document): | ||
|
|
||
| def validate(self): | ||
| self.validate_time() | ||
| self.validate_date() | ||
| self.validate_room_availability() | ||
|
|
||
| def validate_time(self): | ||
| if self.from_time and self.to_time: | ||
| if self.to_time <= self.from_time: | ||
| frappe.throw("To Time must be greater than From Time") | ||
|
|
||
| def validate_date(self): | ||
| if self.booking_date: | ||
| if getdate(self.booking_date) < getdate(nowdate()): | ||
| frappe.throw("Booking Date cannot be in the past") | ||
|
|
||
| def validate_room_availability(self): | ||
| """ | ||
| Ensure booking is within room's available time window | ||
| """ | ||
|
|
||
| if not self.meeting_room: | ||
| return | ||
|
|
||
| room = frappe.get_doc("Room", self.meeting_room) | ||
|
|
||
| from_time = get_time(self.from_time) | ||
| to_time = get_time(self.to_time) | ||
| available_from = get_time(room.availability_from) | ||
| available_to = get_time(room.availability_to) | ||
|
|
||
| if from_time < available_from or to_time > available_to: | ||
| frappe.throw( | ||
| f"Booking not permitted outside room availability hours " | ||
| f"({available_from} - {available_to})" | ||
| ) | ||
9 changes: 9 additions & 0 deletions
9
...dministration_management_system/doctype/meeting_room_booking/test_meeting_room_booking.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright (c) 2026, efeone and Contributors | ||
| # See license.txt | ||
|
|
||
| # import frappe | ||
| from frappe.tests.utils import FrappeTestCase | ||
|
|
||
|
|
||
| class TestMeetingRoomBooking(FrappeTestCase): | ||
| pass |
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.