Skip to content

Commit d97674a

Browse files
authored
Merge pull request #341 from s-aga-r/jmap-calendars
feat: JMAP Calendars
2 parents 50f60a1 + ac59c58 commit d97674a

48 files changed

Lines changed: 4478 additions & 103 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

mail/client/doctype/calendar/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
2+
// For license information, please see license.txt
3+
4+
frappe.ui.form.on('Calendar', {
5+
before_load: (frm) => {
6+
const update_tz_options = () => {
7+
frm.fields_dict.time_zone.set_data(frappe.all_timezones)
8+
}
9+
10+
if (!frappe.all_timezones) {
11+
frappe.call({
12+
method: 'frappe.core.doctype.user.user.get_timezones',
13+
callback: function (r) {
14+
frappe.all_timezones = r.message.timezones
15+
update_tz_options()
16+
},
17+
})
18+
} else {
19+
update_tz_options()
20+
}
21+
},
22+
})
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
{
2+
"actions": [],
3+
"allow_rename": 1,
4+
"creation": "2025-12-09 11:41:03.957394",
5+
"doctype": "DocType",
6+
"engine": "InnoDB",
7+
"field_order": [
8+
"section_break_fgkh",
9+
"user",
10+
"column_break_pjqh",
11+
"subscribed",
12+
"visible",
13+
"default",
14+
"section_break_uaer",
15+
"id",
16+
"_name",
17+
"color",
18+
"sort_order",
19+
"include_in_availability",
20+
"time_zone",
21+
"column_break_tamj",
22+
"description",
23+
"section_break_weht",
24+
"share_with",
25+
"rights_section",
26+
"may_read_free_busy",
27+
"may_read_items",
28+
"may_write_all",
29+
"may_write_own",
30+
"column_break_ezso",
31+
"may_update_private",
32+
"may_rsvp",
33+
"may_admin",
34+
"may_delete"
35+
],
36+
"fields": [
37+
{
38+
"fieldname": "section_break_fgkh",
39+
"fieldtype": "Section Break"
40+
},
41+
{
42+
"description": "The user this calendar belongs to.",
43+
"fieldname": "user",
44+
"fieldtype": "Link",
45+
"in_list_view": 1,
46+
"in_standard_filter": 1,
47+
"label": "User",
48+
"no_copy": 1,
49+
"options": "User",
50+
"reqd": 1,
51+
"set_only_once": 1
52+
},
53+
{
54+
"fieldname": "section_break_uaer",
55+
"fieldtype": "Section Break"
56+
},
57+
{
58+
"description": "The ID of the calendar.",
59+
"fieldname": "id",
60+
"fieldtype": "Data",
61+
"label": "ID",
62+
"no_copy": 1,
63+
"read_only": 1,
64+
"set_only_once": 1
65+
},
66+
{
67+
"fieldname": "column_break_tamj",
68+
"fieldtype": "Column Break"
69+
},
70+
{
71+
"description": "The user-visible name of the calendar.",
72+
"fieldname": "_name",
73+
"fieldtype": "Data",
74+
"in_list_view": 1,
75+
"label": "Name",
76+
"reqd": 1
77+
},
78+
{
79+
"description": "An optional longer-form description of the calendar.",
80+
"fieldname": "description",
81+
"fieldtype": "Small Text",
82+
"label": "Description"
83+
},
84+
{
85+
"description": "A color to be used when displaying events associated with the calendar.",
86+
"fieldname": "color",
87+
"fieldtype": "Color",
88+
"label": "Color"
89+
},
90+
{
91+
"default": "0",
92+
"description": "Defines the sort order of calendars when presented in the client's UI.",
93+
"fieldname": "sort_order",
94+
"fieldtype": "Int",
95+
"in_list_view": 1,
96+
"label": "Sort Order",
97+
"no_copy": 1,
98+
"non_negative": 1
99+
},
100+
{
101+
"fieldname": "column_break_pjqh",
102+
"fieldtype": "Column Break"
103+
},
104+
{
105+
"default": "1",
106+
"description": "Checked if the user has indicated they wish to see this Calendar in their client.",
107+
"fieldname": "subscribed",
108+
"fieldtype": "Check",
109+
"in_list_view": 1,
110+
"label": "Subscribed"
111+
},
112+
{
113+
"default": "1",
114+
"depends_on": "eval: !doc.__islocal",
115+
"description": "Should the calendar's events be displayed to the user at the moment?",
116+
"fieldname": "visible",
117+
"fieldtype": "Check",
118+
"in_list_view": 1,
119+
"label": "Visible",
120+
"read_only": 1
121+
},
122+
{
123+
"default": "0",
124+
"description": "This should be true for exactly one calendar in any account.",
125+
"fieldname": "default",
126+
"fieldtype": "Check",
127+
"in_list_view": 1,
128+
"label": "Default",
129+
"no_copy": 1
130+
},
131+
{
132+
"default": "All",
133+
"depends_on": "eval: !doc.__islocal",
134+
"description": "What calendar's events be used as part of availability calculation?",
135+
"fieldname": "include_in_availability",
136+
"fieldtype": "Select",
137+
"label": "Include In Availability",
138+
"options": "All\nAttending\nNone",
139+
"read_only": 1,
140+
"reqd": 1
141+
},
142+
{
143+
"description": "The time zone to use for events without a time zone.",
144+
"fieldname": "time_zone",
145+
"fieldtype": "Autocomplete",
146+
"label": "Time Zone"
147+
},
148+
{
149+
"collapsible": 1,
150+
"depends_on": "eval: !doc.__islocal",
151+
"fieldname": "rights_section",
152+
"fieldtype": "Section Break",
153+
"label": "Rights"
154+
},
155+
{
156+
"default": "0",
157+
"description": "The user may read the free-busy information for this calendar as part of a call to `Principal/getAvailability`.",
158+
"fieldname": "may_read_free_busy",
159+
"fieldtype": "Check",
160+
"label": "May Read Free Busy",
161+
"no_copy": 1,
162+
"read_only": 1
163+
},
164+
{
165+
"default": "0",
166+
"description": "The user may fetch the events in this calendar.",
167+
"fieldname": "may_read_items",
168+
"fieldtype": "Check",
169+
"label": "May Read Items",
170+
"no_copy": 1,
171+
"read_only": 1
172+
},
173+
{
174+
"default": "0",
175+
"description": "The user may create, modify or destroy all events in this calendar, or move events to or from this calendar.",
176+
"fieldname": "may_write_all",
177+
"fieldtype": "Check",
178+
"label": "May Write All",
179+
"no_copy": 1,
180+
"read_only": 1
181+
},
182+
{
183+
"default": "0",
184+
"description": "The user may create, modify or destroy an event on this calendar if either they are the owner of the event or the event has no owner.",
185+
"fieldname": "may_write_own",
186+
"fieldtype": "Check",
187+
"label": "May Write Own",
188+
"no_copy": 1,
189+
"read_only": 1
190+
},
191+
{
192+
"fieldname": "column_break_ezso",
193+
"fieldtype": "Column Break"
194+
},
195+
{
196+
"default": "0",
197+
"description": "The user may modify per-user properties on all events in the calendar.",
198+
"fieldname": "may_update_private",
199+
"fieldtype": "Check",
200+
"label": "May Update Private",
201+
"no_copy": 1,
202+
"read_only": 1
203+
},
204+
{
205+
"default": "0",
206+
"description": "The user may modify the properties of any Participant object that corresponds to one of the user's Participant Identity objects in the account.",
207+
"fieldname": "may_rsvp",
208+
"fieldtype": "Check",
209+
"label": "May RSVP",
210+
"no_copy": 1,
211+
"read_only": 1
212+
},
213+
{
214+
"default": "0",
215+
"description": "The user may modify the \"shareWith\" property for this calendar.",
216+
"fieldname": "may_admin",
217+
"fieldtype": "Check",
218+
"label": "May Admin",
219+
"no_copy": 1,
220+
"read_only": 1
221+
},
222+
{
223+
"default": "0",
224+
"description": "The user may delete the calendar itself.",
225+
"fieldname": "may_delete",
226+
"fieldtype": "Check",
227+
"label": "May Delete",
228+
"no_copy": 1,
229+
"read_only": 1
230+
},
231+
{
232+
"fieldname": "section_break_weht",
233+
"fieldtype": "Section Break"
234+
},
235+
{
236+
"description": "The principals this calendar is shared with, and the access rights granted to each.",
237+
"fieldname": "share_with",
238+
"fieldtype": "Table",
239+
"label": "Share With",
240+
"options": "Calendar Rights",
241+
"read_only_depends_on": "eval: !doc.may_admin"
242+
}
243+
],
244+
"grid_page_length": 50,
245+
"index_web_pages_for_search": 1,
246+
"is_virtual": 1,
247+
"links": [
248+
{
249+
"link_doctype": "Calendar Event",
250+
"link_fieldname": "calendar"
251+
}
252+
],
253+
"modified": "2026-01-23 14:42:44.306278",
254+
"modified_by": "Administrator",
255+
"module": "Client",
256+
"name": "Calendar",
257+
"owner": "Administrator",
258+
"permissions": [
259+
{
260+
"create": 1,
261+
"delete": 1,
262+
"email": 1,
263+
"export": 1,
264+
"print": 1,
265+
"read": 1,
266+
"report": 1,
267+
"role": "System Manager",
268+
"share": 1,
269+
"write": 1
270+
},
271+
{
272+
"create": 1,
273+
"delete": 1,
274+
"read": 1,
275+
"role": "Mail User",
276+
"write": 1
277+
}
278+
],
279+
"row_format": "Dynamic",
280+
"rows_threshold_for_grid_search": 20,
281+
"sort_field": "creation",
282+
"sort_order": "DESC",
283+
"states": []
284+
}

0 commit comments

Comments
 (0)