Created
December 14, 2023 15:17
-
-
Save papinianus/892e0f5266c0b34190e59497300fd04a to your computer and use it in GitHub Desktop.
既読管理のサイトパッケージ
This file contains 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
{ | |
"HeaderInfo": { | |
"AssemblyVersion": "1.3.49.0", | |
"BaseSiteId": 9538878, | |
"Server": "https://demo.pleasanter.org", | |
"CreatorName": "テナント管理者", | |
"PackageTime": "2023-12-14T15:16:15.8933625+00:00", | |
"Convertors": [ | |
{ | |
"SiteId": 9538878, | |
"SiteTitle": "既読管理", | |
"ReferenceType": "Sites", | |
"IncludeData": false, | |
"Order": "[9538880,9538879,9538893]" | |
}, | |
{ | |
"SiteId": 9538880, | |
"SiteTitle": "記録テーブル", | |
"ReferenceType": "Results", | |
"IncludeData": false | |
}, | |
{ | |
"SiteId": 9538893, | |
"SiteTitle": "hidden", | |
"ReferenceType": "Sites", | |
"IncludeData": false, | |
"Order": "[]" | |
}, | |
{ | |
"SiteId": 9538879, | |
"SiteTitle": "管理用", | |
"ReferenceType": "Results", | |
"IncludeData": false | |
} | |
], | |
"IncludeSitePermission": true, | |
"IncludeRecordPermission": false, | |
"IncludeColumnPermission": false, | |
"IncludeNotifications": false, | |
"IncludeReminders": false | |
}, | |
"Sites": [ | |
{ | |
"TenantId": 13658, | |
"SiteId": 9538878, | |
"Title": "既読管理", | |
"SiteName": "", | |
"SiteGroupName": "", | |
"Body": "", | |
"GridGuide": "", | |
"EditorGuide": "", | |
"CalendarGuide": "", | |
"CrosstabGuide": "", | |
"GanttGuide": "", | |
"BurnDownGuide": "", | |
"TimeSeriesGuide": "", | |
"KambanGuide": "", | |
"ImageLibGuide": "", | |
"ReferenceType": "Sites", | |
"ParentId": 9536168, | |
"InheritPermission": 9538878, | |
"SiteSettings": { | |
"Version": 1.017, | |
"ReferenceType": "Sites", | |
"NoDisplayIfReadOnly": false | |
}, | |
"Publish": false, | |
"DisableCrossSearch": false, | |
"Comments": [] | |
}, | |
{ | |
"TenantId": 13658, | |
"SiteId": 9538880, | |
"Title": "記録テーブル", | |
"SiteName": "", | |
"SiteGroupName": "", | |
"Body": "", | |
"GridGuide": "", | |
"EditorGuide": "", | |
"CalendarGuide": "", | |
"CrosstabGuide": "", | |
"GanttGuide": "", | |
"BurnDownGuide": "", | |
"TimeSeriesGuide": "", | |
"KambanGuide": "", | |
"ImageLibGuide": "", | |
"ReferenceType": "Results", | |
"ParentId": 9538878, | |
"InheritPermission": 9538880, | |
"SiteSettings": { | |
"Version": 1.017, | |
"ReferenceType": "Results", | |
"GridColumns": [ | |
"ResultId", | |
"Title", | |
"Body", | |
"NumA", | |
"CheckA" | |
], | |
"EditorColumnHash": { | |
"General": [ | |
"ResultId", | |
"Title", | |
"Body", | |
"CheckA", | |
"NumA" | |
] | |
}, | |
"Columns": [ | |
{ | |
"ColumnName": "CheckA", | |
"LabelText": "既読", | |
"EditorReadOnly": true | |
}, | |
{ | |
"ColumnName": "NumA", | |
"LabelText": "見た人の数", | |
"EditorReadOnly": true | |
} | |
], | |
"Scripts": [ | |
{ | |
"Title": "log", | |
"Edit": true, | |
"Body": "const ledgerSiteId = 9538879;\nconst mark = () => {\n $p.apiCreate({\n id: ledgerSiteId,\n data: {\n Owner: $p.userId(),\n ApiVersion: 1.1,\n NumHash: {\n NumA: $p.id(),\n },\n },\n done: (data) => {\n console.log(data);\n },\n fail: (data) => {\n console.log(data);\n },\n });\n};\n$p.events.on_editor_load = () => {\n if (!$p.getControl('CheckA').prop('checked')) {\n setTimeout(mark, 5000); //5 秒滞在したら既読にする\n }\n};", | |
"Id": 1 | |
} | |
], | |
"ServerScripts": [ | |
{ | |
"Title": "who_visited", | |
"Name": "", | |
"BeforeOpeningPage": true, | |
"BeforeOpeningRow": true, | |
"Body": "const ledgerSiteId = 9538879;\nconst me = context.UserId;\nconst id = model.ResultId;\n\nconst visited = {\n View: {\n ColumnFilterHash: {\n // Owner: me,\n NumA: id,\n },\n },\n};\ntry {\n const results = items.Get(ledgerSiteId, JSON.stringify(visited));\n let includesMe = false;\n for (const result of results) {\n includesMe |= result.Owner === me;\n }\n model.CheckA = includesMe;\n model.NumA = results.Length;\n} catch (e) {\n context.Log(e);\n}\n", | |
"Id": 1 | |
} | |
], | |
"NoDisplayIfReadOnly": false | |
}, | |
"Publish": false, | |
"DisableCrossSearch": false, | |
"Comments": [] | |
}, | |
{ | |
"TenantId": 13658, | |
"SiteId": 9538893, | |
"Title": "hidden", | |
"SiteName": "", | |
"SiteGroupName": "", | |
"Body": "", | |
"GridGuide": "", | |
"EditorGuide": "", | |
"CalendarGuide": "", | |
"CrosstabGuide": "", | |
"GanttGuide": "", | |
"BurnDownGuide": "", | |
"TimeSeriesGuide": "", | |
"KambanGuide": "", | |
"ImageLibGuide": "", | |
"ReferenceType": "Sites", | |
"ParentId": 9538878, | |
"InheritPermission": 9538893, | |
"SiteSettings": { | |
"Version": 1.017, | |
"ReferenceType": "Sites", | |
"NoDisplayIfReadOnly": false | |
}, | |
"Publish": false, | |
"DisableCrossSearch": false, | |
"Comments": [] | |
}, | |
{ | |
"TenantId": 13658, | |
"SiteId": 9538879, | |
"Title": "管理用", | |
"SiteName": "", | |
"SiteGroupName": "", | |
"Body": "", | |
"GridGuide": "", | |
"EditorGuide": "", | |
"CalendarGuide": "", | |
"CrosstabGuide": "", | |
"GanttGuide": "", | |
"BurnDownGuide": "", | |
"TimeSeriesGuide": "", | |
"KambanGuide": "", | |
"ImageLibGuide": "", | |
"ReferenceType": "Results", | |
"ParentId": 9538893, | |
"InheritPermission": 9538879, | |
"SiteSettings": { | |
"Version": 1.017, | |
"ReferenceType": "Results", | |
"GridColumns": [ | |
"ResultId", | |
"NumA", | |
"Owner" | |
], | |
"EditorColumnHash": { | |
"General": [ | |
"ResultId", | |
"NumA", | |
"Owner" | |
] | |
}, | |
"ServerScripts": [ | |
{ | |
"Title": "uniq_check", | |
"Name": "", | |
"BeforeCreate": true, | |
"Body": "const selfId = context.SiteId;\nconst resultId = model.NumA;\nconst who = model.Owner;\nconst any = {\n View: {\n ColumnFilterHash: {\n Owner: who,\n NumA: resultId,\n },\n },\n};\ntry {\n const results = items.Get(selfId, JSON.stringify(any));\n if (results.Length > 0) {\n context.Error(`duplicate entry: ${who}, ${resultId}`);\n }\n} catch (e) {\n context.Log(e);\n}", | |
"Id": 1 | |
} | |
], | |
"NoDisplayIfReadOnly": true | |
}, | |
"Publish": false, | |
"DisableCrossSearch": false, | |
"Comments": [] | |
} | |
], | |
"Data": [], | |
"Permissions": [ | |
{ | |
"SiteId": 9538878, | |
"Permissions": [ | |
{ | |
"ReferenceId": 9538878, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": -1, | |
"PermissionType": 31 | |
}, | |
{ | |
"ReferenceId": 9538878, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": 275509, | |
"PermissionType": 511 | |
} | |
] | |
}, | |
{ | |
"SiteId": 9538880, | |
"Permissions": [ | |
{ | |
"ReferenceId": 9538880, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": -1, | |
"PermissionType": 31 | |
}, | |
{ | |
"ReferenceId": 9538880, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": 275509, | |
"PermissionType": 511 | |
} | |
] | |
}, | |
{ | |
"SiteId": 9538893, | |
"Permissions": [ | |
{ | |
"ReferenceId": 9538893, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": 275509, | |
"PermissionType": 511 | |
} | |
] | |
}, | |
{ | |
"SiteId": 9538879, | |
"Permissions": [ | |
{ | |
"ReferenceId": 9538879, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": -1, | |
"PermissionType": 3 | |
}, | |
{ | |
"ReferenceId": 9538879, | |
"DeptId": 0, | |
"GroupId": 0, | |
"UserId": 275509, | |
"PermissionType": 511 | |
} | |
] | |
} | |
], | |
"PermissionIdList": { | |
"DeptIdList": [], | |
"GroupIdList": [], | |
"UserIdList": [ | |
{ | |
"UserId": 275509, | |
"LoginId": "Tenant13658_User1" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment