Pages Clone System What it does Clones the entire webapp to another server. Only works on linux. First setup Generate an SSH key for the tomcat-user on the source server sudo -u tomcat ssh-keygen Add the public key to a user on the target server that has sudo-access Connect from the source server, as tomcat, to the target server and accept the certificate Add configurations How to invoke Invoke the codeunit, as an admin. eg. [SERVER]/main?command=common.CloneSystem Options Control the behavior with the following url-parameters. Parameter Desctiption with-users Also clones the users and their groups with-files Also clones the files uploaded dont-backup-target Does not create a copy of the database on the target server with the name _backupyyyyMMddHHmm dont-clean Does not remove the sql files on both systems Configuration Config Default Description CloneSystem.targetServer IP or domain of target server CloneSystem.targetUser ec2-user Name of the user that is being used on the target server CloneSystem.targetBasePath Policy:applicationBasePath Webapps, folder on target server CloneSystem.targetApp Policy:applicationName Application name on target server CloneSystem.targetDb DbLive-name Name of live server on target server Developer info Type: CodeunitPagecontent Security: Requires session Classpath: com.tsnocode.codeunit.common.CloneSystem Copy Structure What it does Will copy all fields except files and pictures, but all sub child entities (1 level, non recursive). How to invoke The page is called with the command: dk.tempusserva.codeunit.common.PageCopyStructure Takes the following parameters SagID DataID The user activating the function must have the group specified in "AllowCloneGroup" Example of usage: main?command=dk.tempusserva.codeunit.common.PageCopyStructure&SagID=10&DataID=100 Button for the function can be created using a "Action button: Button: Parameterized URL" Example of URL pattern main?command=dk.tempusserva.codeunit.common.PageCopyStructure&SagID=10&DataID=[DataID] Configuration [All possible configurations and where to edit them] Developer info Type: CodeunitPagecontent Security: [eg. requires admin or session] Classpath: dk.tempusserva.codeunit.common.PageCopyStructure Clone records Usage This function will copy a single record Configuration guide Add a button with parameterized URL using: main?command=com.tsnocode.codeunit.common.CloneRecord&SagID=[SagID]&DataID=[DataID] Developer info Type: CodeunitPagecontent Security: [eg. requires admin or session] Classpath: com.tsnocode.codeunit.common.CloneRecord Static Content What it does Displays configurable static HTML code. How to invoke Make a http request: main?command=dk.p2e.blanket.codeunit.common.PageStaticContent Configuration Set up HTML: Designer > Modules > Static content > StaticPageContent Developer info Type: CodeunitPagecontent Security: Requires session Classpath: dk.p2e.blanket.codeunit.common.PageStaticContent Users By Group What it does Displays list of active users in the system. Multi mode function User normal: No filters User exclusive group: Filters users/groups that active user belongs to You can navigate through the pages Lists exclusive groups + none Lists users in selected exclusive group (1) Lists groups for selected user (2) How to invoke Make a http request: main?command= dk.p2e.blanket.codeunit.common.PageUsersByGroup Configuration None Developer info Type: CodeunitPagecontent Security: Requires UderEditor or Admin Classpath: dk.p2e.blanket.codeunit.common.PageUsersByGroup Users Online What it does Displays a list of users with a session on the current server How to invoke Make a http request: main?command=common.PageUsersOnline Configuration None Developer info Type: CodeunitPagecontent Security: Requires admin Classpath: dk.p2e.blanket.codeunit.common.PageUsersOnline Website Iframe What it does Displays a configurable webpage in an IFrame. How to invoke Make a http request: main?command=dk.p2e.blanket.codeunit.common.PageWebsiteIframe Configuration Set up IFrame options: Designer > Modules > Static content WebsiteIframeURL WebsiteIframeWidth WebsiteIframeHeight Developer info Type: CodeunitPagecontent Security: Requires session Classpath: dk.p2e.blanket.codeunit.common.PageWebsiteIframe Solution Structure View What it does Lists the components (fields, status etc.) in the current solution. How to invoke Make a http request including a valid SagID: main?SagID=[SagID]&command=common.SolutionStructureView Configuration None Developer info Type: CodeunitPagecontent Security: Requires session Classpath: dk.p2e.blanket.codeunit.common.SolutionStructureView Gantt Diagram What it does The platform has a build-in gantt chart generator. It supports zooming, nesting and relations. The datastructure has to be a single entity. If your data isn't contained in a single entity use Gantt Sync CodeUnit . Sample How to invoke To view the gantt chart, access: main?command=dk.tempusserva.gantt.DhtmlXGanttPage&SagID=[SagID] Options Basic setup To view a gantt chart, first access the page main?command=dk.tempusserva.gantt.DhtmlXGanttPage to generate the required static configurations . Six fields are required in the table, that the data is being read from: Code, Title, Group, Start date, End date and Progress. Code and Title have to be single-line text inputs. Progress has to be an integer input, it represents how far along the task is, in percent. Start and End date have to be dates. Group should store the DataID of the parent-task. Here a database-lookup is used, executing query: SELECT DataID, Resume FROM data_ganttdata and displaying field Resume. Also at least 5 statuses: Active, Suspended, Completed, Failed and Waiting. All other statuses will be marked as Undefined. Sample Relations To view relations between tasks, create another table. Two fields are required: From and To. A third field Type can be added, but isn't required. From and To have to store the DataID of the tasks that should be linked via a relation. This setup is the same as Group. Type has to have value of 1 or 0, any other value is overwritten to 0. This defines whether the relation is drawn from the beginning (1) or end (0) of the From-task. To view the gantt chart, access: main?command=dk.tempusserva.gantt.DhtmlXGanttPage&SagID=[SagID]&LinkSagID=[RelationSagID] Sample Configuration Static config Default value Description Gantt.Field.Group GROUP_VALUE Name of the column that contains the DataID of parent-task Gantt.Field.StartDate STARTDATE Name of the column that contains the task-start date Gantt.Field.EndDate ENDDATE Name of the column that contains the task-end date Gantt.Field.Code CODE Name of the column that contains the task-code Gantt.Field.Title TITLE Name of the column that contains the task-title Gantt.Field.Progress PROGRESS Name of the column that contains the task-progress Gantt.Filter.Field TASKTYPE Name of a column that contains a value that should be filtered to match Gantt.Filter.Value Gantt.Filter.Value 249 Value that task have to equal in column Gantt.Filter.Field Gantt.Field.Link.From FROM Name of column that contains DataID of source-task in a relation Gantt.Field.Link.To TO Name of column that contains DataID of target-task in a relation Gantt.Field.Link.Type Name of column that contains type of relation, not required Gantt.StatusID.Active 1 ID of status that marks a task as Active Gantt.StatusID.Waiting 2 ID of status that marks a task as Waiting Gantt.StatusID.Suspended 3 ID of status that marks a task as Suspended Gantt.StatusID.Completed 4 ID of status that marks a task as Completed Gantt.StatusID.Failed 5 ID of status that marks a task as Failed Gantt.StatusColor.Undefined #858586 CSS-color of tasks with status Undefined Gantt.StatusColor.Active #76C0F1 CSS-color of tasks with status Active Gantt.StatusColor.Waiting #F6BF5F CSS-color of tasks with status Waiting Gantt.StatusColor.Suspended #F28F42 CSS-color of tasks with status Suspended Gantt.StatusColor.Completed #4DBE6C CSS-color of tasks with status Completed Gantt.StatusColor.Failed #E70015 CSS-color of tasks with status Failed Advanced usage It's possible to override the static content. To do so, add the desired value to the url. Example: To override the field used for Title, add &Gantt.Field.Title=[field-name] to the url Exporting The chart supports exporting to Excel and iCal formats. It's possible to overwrite the export, be declaring a javascript function named customExportToExcel or customExportToICal . Either takes one argument: the gantt object. Heres an example that removes html markup from the gantt titles before export. function customExportToExcel(gantt) { var data = gantt.getDatastore("task").getVisibleItems(); var rtn = []; for (var i = 0; i < data.length; i++) { var d = new Date(data[i].start_date); rtn[i] = { color: data[i].color, duration: data[i].duration, id: data[i].id, open: data[i].open, parent: (data[i].parent == "0" || data[i].parent == 0 ? "" : data[i].parent), progress: data[i].progress, start_date: d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2) + " " + ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2), text: $(data[i].text).text(), }; } console.log(rtn); viewGantt({data: rtn, links: []}); setTimeout(function() { gantt.exportToExcel(); }, 5); setTimeout(loadGantt, 100); } Developer info Type: CodeunitPagecontent Security: Requires session Classpath: dk.tempusserva.gantt.DhtmlXGanttPage Move a File What it does Moves a file from one document-field to another, on the same entity. Works between document-fields with and without signing. How to invoke Add the following snippet to the entity scripts. This enables movement between all document-fields on the entity. It adds another column to the file-lists, with a "Move" link. When clicked it opens a popup, with a dropdown where the new field can be selected. const moveFile = (id, to) => { const params = new URLSearchParams(window.location.search) $.ajax({ url: "main", method: "GET", data: { "command": "dk.tempusserva.codeunit.common.MoveFile", "SagID": params.get("SagID"), "DataID": params.get("DataID"), "FileID": id.split("_")[2], "FieldFrom": id.split("_")[1], "FieldTo": to, }, success: (data) => { if (data == "File moved") { $(`#${id}`).find("td").last().html("Moved") } else { alert(data) } }, }) } $(() => { const moveFileAction = () => { console.log("yay") moveFile($("#modeFileFrom").val(), $("#moveFileTo").val()) $("#moveFilePopup").remove() } $(() => { $(".tableFiles").each((i,e) => { let t = $(e) t.find("thead").find("tr").each((i,e) => { $(e).append("