Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68a7052c35 | ||
|
|
aaf367480b | ||
|
|
f5476d7f1c | ||
|
|
b1af757976 | ||
|
|
9694b90a88 | ||
|
|
b69429e09e | ||
|
|
3b0693560e | ||
|
|
af1bca6b99 | ||
|
|
ba841978ae | ||
|
|
f2a176ea9b | ||
|
|
097336d66d | ||
|
|
1d7b47aaa0 | ||
|
|
f49b44cd56 | ||
|
|
60777feaa3 | ||
|
|
bcc1182dea | ||
|
|
4a83bb6bee | ||
|
|
0879b53a88 | ||
|
|
6aa858e299 |
@@ -13,6 +13,13 @@ jobs:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_PATH }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- name: Build docker image
|
||||
run: docker build -t umbrella .
|
||||
|
||||
@@ -28,24 +35,12 @@ jobs:
|
||||
docker tag umbrella ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
||||
docker tag umbrella ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_PATH }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- name: Push to registry
|
||||
run: |
|
||||
TAG=$(cat /tmp/tag)
|
||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
|
||||
|
||||
- name: Restart umbrella.srsoftware.de
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
run: |
|
||||
curl -X POST -H "Authorization: Bearer ${{ secrets.ELDORADO_MAKE_BEARER }}" -d umbrella_25_start https://make.eldorado.srsoftware.de/launch
|
||||
|
||||
Clean-Registry:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -14,7 +14,6 @@ import de.srsoftware.umbrella.bookmarks.BookmarkApi;
|
||||
import de.srsoftware.umbrella.company.CompanyModule;
|
||||
import de.srsoftware.umbrella.contact.ContactModule;
|
||||
import de.srsoftware.umbrella.core.SettingsService;
|
||||
import de.srsoftware.umbrella.core.Util;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import de.srsoftware.umbrella.documents.DocumentApi;
|
||||
import de.srsoftware.umbrella.files.FileModule;
|
||||
@@ -34,7 +33,6 @@ import de.srsoftware.umbrella.translations.Translations;
|
||||
import de.srsoftware.umbrella.user.UserModule;
|
||||
import de.srsoftware.umbrella.web.WebHandler;
|
||||
import de.srsoftware.umbrella.wiki.WikiModule;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
@@ -15,7 +15,6 @@ import static java.lang.System.Logger.Level.*;
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.xrbpowered.jparsedown.JParsedown;
|
||||
import de.srsoftware.tools.Mappable;
|
||||
import de.srsoftware.tools.Query;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
@@ -27,12 +26,13 @@ import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class Util {
|
||||
@@ -188,4 +188,19 @@ jspreadsheet(document.getElementById('spreadsheet'), {
|
||||
public static String dateTimeOf(long epochMilis){
|
||||
return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMilis), ZoneId.systemDefault()).format(TIME_FORMATTER);
|
||||
}
|
||||
|
||||
public static String toJson(ResultSet rs) {
|
||||
try {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
var meta = rs.getMetaData();
|
||||
for (int col = 1; col <= meta.getColumnCount(); col++) {
|
||||
var key = meta.getColumnName(col);
|
||||
var val = rs.getObject(col);
|
||||
map.put(key, val);
|
||||
}
|
||||
return new JSONObject(map).toString();
|
||||
} catch (SQLException e){
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
{#if messages.warning}
|
||||
<span class="warn">{@html messages.warning}</span>
|
||||
{/if}
|
||||
<Route path="/" component={User} />
|
||||
<Route path="/" component={ProjectList} />
|
||||
<Route path="/account/:id" component={Account} />
|
||||
<Route path="/accounting" component={Accounts} />
|
||||
<Route path="/accounting/new" component={NewAccount} />
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
|
||||
function calcSums(){
|
||||
let sums = {};
|
||||
sums[0] = 0;
|
||||
sums[ 0] = 0;
|
||||
sums[-1] = 0;
|
||||
for (let user of Object.values(users)) sums[user.id] = 0;
|
||||
for (let transaction of filtered) {
|
||||
for (let user of Object.values(users)){
|
||||
if (user.id == transaction.destination.id) sums[user.id] += transaction.amount;
|
||||
if (user.id == transaction.source.id) sums[user.id] -= transaction.amount;
|
||||
}
|
||||
if (!transaction.destination.id) sums[0] += transaction.amount;
|
||||
if (!transaction.source.id) sums[0] -= transaction.amount;
|
||||
if (!transaction.destination.id) sums[ 0] += transaction.amount;
|
||||
if (!transaction.source.id) sums[-1] += transaction.amount;
|
||||
}
|
||||
return sums;
|
||||
}
|
||||
@@ -102,7 +103,10 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.amount{ text-align: right }
|
||||
:global {
|
||||
.amount{ text-align: right }
|
||||
.nowrap{ whitespace: nowrap }
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
@@ -154,10 +158,16 @@
|
||||
</th>
|
||||
{/each}
|
||||
<td class="amount">
|
||||
<br/>
|
||||
{sums[0].toFixed(2)} {account.currency}
|
||||
{sums[-1].toFixed(2)} {account.currency} <br/>
|
||||
-{sums[0].toFixed(2)} {account.currency}<br/>
|
||||
{(sums[-1]-sums[0]).toFixed(2)} {account.currency}
|
||||
</td>
|
||||
<td colspan="3"></td>
|
||||
<td class="nowrap">
|
||||
{t('external gains')}<br/>
|
||||
{t('external expenses')}<br/>
|
||||
{t('sum external')}
|
||||
</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
</span>
|
||||
|
||||
<ul>
|
||||
{#each accounts as account (account.id)}
|
||||
{#each accounts.toSorted((a,b) => a.name.localeCompare(b.name)) as account (account.id)}
|
||||
<li>
|
||||
<a {onclick} href="/account/{account.id}">{account.name} ({account.id})</a>
|
||||
<a {onclick} href="/account/{account.id}">{account.name}</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<legend>{t('state_open')}</legend>
|
||||
{#if sorted}
|
||||
{#each sorted as task}
|
||||
{#if task.status == 20 && match(task)}
|
||||
{#if task.status < 60 && task.status >= 20 && match(task)}
|
||||
<div href={`/task/${task.id}/view`} title={task.description.source} task_id={task.id} {onclick} {oncontextmenu} {ontouchstart} {ontouchend} onmousedown={ontouchstart} onmouseup={ontouchend} >
|
||||
{task.name}
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
let { project, select = o => {}, task } = $props();
|
||||
let tree = $state({});
|
||||
let loading = $state(true);
|
||||
|
||||
async function loadParentCandidates(){
|
||||
let url = api(`task/${task.id}/parent_candidates`);
|
||||
@@ -14,6 +15,7 @@
|
||||
if (res.ok){
|
||||
yikes();
|
||||
tree = await res.json();
|
||||
loading = false;
|
||||
} else error(res);
|
||||
}
|
||||
|
||||
@@ -21,7 +23,16 @@
|
||||
</script>
|
||||
|
||||
<div class="overlay parent_selector">
|
||||
<h2>{t('select a new parent for {entity}',{entity:task.name})}</h2>
|
||||
<h2>
|
||||
{t('select a new parent for {entity}',{entity:task.name})}
|
||||
<button onclick={ev => select(null)}>{t('abort')}</button>
|
||||
</h2>
|
||||
{t('project')}: {project.name}
|
||||
{#if loading}
|
||||
<p>
|
||||
{t('loading')}
|
||||
</p>
|
||||
{:else}
|
||||
<TaskTree {tree} {select} />
|
||||
{/if}
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
function update_parent(newVal){
|
||||
select_parent = false;
|
||||
update({parent_task_id:newVal.id});
|
||||
if (newVal) update({parent_task_id:newVal.id});
|
||||
}
|
||||
|
||||
function updatePermission(user_id,permission){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { useTinyRouter } from 'svelte-tiny-router';
|
||||
import { api, drop, patch, post } from '../../urls.svelte.js';
|
||||
import { api, drop, get, patch, post } from '../../urls.svelte.js';
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte.js';
|
||||
import { timetrack } from '../../user.svelte.js';
|
||||
@@ -41,10 +41,18 @@
|
||||
});
|
||||
|
||||
async function addTime(task_id){
|
||||
const url = api(`time/track_task/${task_id}`);
|
||||
const resp = await post(url,now()); // create new time or return time with assigned tasks
|
||||
let url = api(`time/track_task/${task_id}`);
|
||||
let resp = await post(url,now()); // create new time or return time with assigned tasks
|
||||
if (resp.ok) {
|
||||
const track = await resp.json();
|
||||
if (timetrack.running){
|
||||
url = api(`time/${timetrack.running.id}`);
|
||||
resp = await get(url);
|
||||
if (resp.ok){
|
||||
let previous = await resp.json();
|
||||
times[previous.id] = previous;
|
||||
}
|
||||
}
|
||||
timetrack.running = track;
|
||||
} else {
|
||||
error(resp);
|
||||
|
||||
@@ -14,11 +14,8 @@ import de.srsoftware.configuration.Configuration;
|
||||
import de.srsoftware.tools.Path;
|
||||
import de.srsoftware.umbrella.core.BaseHandler;
|
||||
import de.srsoftware.umbrella.core.ModuleRegistry;
|
||||
import de.srsoftware.umbrella.core.Util;
|
||||
import de.srsoftware.umbrella.core.api.MarkdownService;
|
||||
import de.srsoftware.umbrella.core.constants.Field;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@@ -18,10 +18,12 @@ import static de.srsoftware.umbrella.core.model.Status.*;
|
||||
import static de.srsoftware.umbrella.core.model.Translatable.t;
|
||||
import static de.srsoftware.umbrella.project.Constants.*;
|
||||
import static de.srsoftware.umbrella.task.Constants.*;
|
||||
import static java.lang.System.Logger.Level.TRACE;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import de.srsoftware.tools.jdbc.Query;
|
||||
import de.srsoftware.umbrella.core.BaseDb;
|
||||
import de.srsoftware.umbrella.core.Util;
|
||||
import de.srsoftware.umbrella.core.constants.Text;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import de.srsoftware.umbrella.core.model.*;
|
||||
@@ -242,6 +244,7 @@ CREATE TABLE IF NOT EXISTS {0} (
|
||||
var tasks = new HashMap<Long,Task>();
|
||||
var rs = query.exec(db);
|
||||
while (rs.next()){
|
||||
LOG.log(TRACE,() -> Util.toJson(rs));
|
||||
var task = Task.of(rs);
|
||||
tasks.put(task.id(),task);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public class TaskModule extends BaseHandler implements TaskService {
|
||||
private boolean getParentCandidates(HttpExchange ex, long taskId, UmbrellaUser user) throws IOException {
|
||||
var task = taskDb.load(taskId);
|
||||
var project = projectService().load(task.projectId());
|
||||
var projectTasks = taskDb.listProjectTasks(project.id(),null, false);
|
||||
var projectTasks = taskDb.listProjectTasks(project.id(),null, true);
|
||||
var mapped = projectTasks.values().stream().collect(Collectors.toMap(Task::id,Task::toMap));
|
||||
var roots = new HashMap<Long,Map<String,Object>>();
|
||||
for (var map : mapped.values()){
|
||||
|
||||
@@ -79,8 +79,15 @@ public class TimeModule extends BaseHandler implements TimeService {
|
||||
if (user.isEmpty()) return unauthorized(ex);
|
||||
var head = path.pop();
|
||||
return switch (head) {
|
||||
case STARTED -> getStartedTime(user.get(),ex);
|
||||
case null, default -> super.doGet(path,ex);
|
||||
case STARTED -> getStartedTime(user.get(),ex);
|
||||
case null -> super.doGet(path,ex);
|
||||
default -> {
|
||||
try {
|
||||
yield sendContent(ex,timeDb.load(Long.parseLong(head)));
|
||||
} catch (NumberFormatException ignored) {
|
||||
yield super.doGet(path,ex);
|
||||
}
|
||||
}
|
||||
};
|
||||
} catch (UmbrellaException e){
|
||||
return send(ex,e);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"abort": "abbrechen",
|
||||
"account": "Konto",
|
||||
"accounting": "Konten",
|
||||
"account name": "Konto-Name",
|
||||
"accounts": "Konten",
|
||||
"actions": "Aktionen",
|
||||
"add_login_service": "Login-Service anlegen",
|
||||
@@ -75,6 +76,7 @@
|
||||
"CREATE_USERS": "Nutzer anlegen",
|
||||
"create_pdf": "PDF erzeugen",
|
||||
"created_with": "erzeugt mit {tool} von {producer}",
|
||||
"currency": "Währung",
|
||||
"customer": "Kunde",
|
||||
"customer_address": "Adresse",
|
||||
"customer_email": "Emailadresse des Kunden",
|
||||
@@ -124,6 +126,8 @@
|
||||
"evaluate": "auswerten",
|
||||
"expand_on_click": "Anklicken zum Anzeigen",
|
||||
"extended_settings": "erweiterte Einstellungen",
|
||||
"external expenses": "externe Ausgaben",
|
||||
"external gains": "externe Einnahmen",
|
||||
|
||||
"failed": "fehlgeschlagen",
|
||||
"failed_login_attempts" : "Account nach {attempts} fehlgeschlagenen Logins gesperrt bis {release_time}",
|
||||
@@ -162,6 +166,7 @@
|
||||
"files": "Dateien",
|
||||
"filter": "Filter",
|
||||
"filter by tags": "Nach Tags filtern",
|
||||
"first_transaction": "erste Transaktion",
|
||||
"footer": "Fuß-Text",
|
||||
"foreign_id": "externe Kennung",
|
||||
"forgot_pass" : "Password vergessen?",
|
||||
@@ -374,6 +379,7 @@
|
||||
"subtask": "Unteraufgabe",
|
||||
"subtasks": "Unteraufgaben",
|
||||
"succeeding_document": "Nachfolge-Dokument",
|
||||
"sum external": "Summe externe Umsätze",
|
||||
"sum_of_records": "Summe der ausgewählten Einträge",
|
||||
"sums": "Summen",
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"abort": "abort",
|
||||
"account": "account",
|
||||
"accounting": "accounting",
|
||||
"account name": "Account name",
|
||||
"accounts": "accounts",
|
||||
"actions": "actions",
|
||||
"add_login_service": "add login service",
|
||||
@@ -75,6 +76,7 @@
|
||||
"CREATE_USERS": "create users",
|
||||
"create_pdf": "create PDF",
|
||||
"created_with": "created with {tool} by {producer}",
|
||||
"currency": "Currency",
|
||||
"customer": "customer",
|
||||
"customer_address": "address",
|
||||
"customer_email": "customer email address",
|
||||
@@ -124,6 +126,8 @@
|
||||
"evaluate": "evaluate",
|
||||
"expand_on_click": "click to expand",
|
||||
"extended_settings": "extended settings",
|
||||
"external expenses": "external expenses",
|
||||
"external gains": "external gains",
|
||||
|
||||
"failed": "failed",
|
||||
"failed_login_attempts" : "account locked until {release_time} after {attempts} failed login attempts",
|
||||
@@ -162,6 +166,7 @@
|
||||
"files": "files",
|
||||
"filter": "filter",
|
||||
"filter by tags": "filter by tags",
|
||||
"first_transaction": "first transaction",
|
||||
"footer": "footer",
|
||||
"foreign_id": "external ID",
|
||||
"forgot_pass" : "forgot password?",
|
||||
@@ -374,6 +379,7 @@
|
||||
"subtask": "subtask",
|
||||
"subtasks": "subtasks",
|
||||
"succeeding_document": "succeeding document",
|
||||
"sum external";"sum of external positions",
|
||||
"sum_of_records": "sum of records",
|
||||
"sums": "sums",
|
||||
|
||||
@@ -459,11 +465,11 @@
|
||||
"wiki_pages": "wiki pages",
|
||||
|
||||
"year": "year",
|
||||
"You have been added to the new project '{project}', created by {user}:\n\n{body}": "You have been added to the new project '{project}', created by {user}:\n\n{body}",
|
||||
"You can view/edit this transaction at {base_url}/account/{id}": "Du kannst diese transaktion unter {base_url}/account/{id} ansehen",
|
||||
"You can view/edit this transaction at {base_url}/account/{id}": "You can view/edit this transaction at {base_url}/account/{id}",
|
||||
"You can view/edit this project at {base_url}/project/{id}/view": "You can view/edit this project at {base_url}/project/{id}/view",
|
||||
"You can view/edit this task at {base_url}/task/{id}/view": "You can view/edit this task at {base_url}/task/{id}/view",
|
||||
"You can view/edit this wiki page at {base_url}/wiki/{id}/view": "You can view/edit this wiki page at {base_url}/wiki/{id}/view",
|
||||
"You have been added to the new project '{project}', created by {user}:\n\n{body}": "You have been added to the new project '{project}', created by {user}:\n\n{body}",
|
||||
"You may change your notification settings at {base_url}/message/settings": "You may change your notification settings at {base_url}/message/settings .",
|
||||
"Your token to create a new password" : "Your token to create a new password",
|
||||
"your_profile": "your profile"
|
||||
|
||||
Reference in New Issue
Block a user