Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d7b47aaa0 | |||
| f49b44cd56 | |||
| 60777feaa3 | |||
| bcc1182dea | |||
| 4a83bb6bee | |||
| 0879b53a88 | |||
| 6aa858e299 |
@@ -41,11 +41,6 @@ jobs:
|
|||||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
|
||||||
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
|
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:
|
Clean-Registry:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public interface AccountDb {
|
|||||||
|
|
||||||
Collection<UmbrellaUser> getMembers(long accountId);
|
Collection<UmbrellaUser> getMembers(long accountId);
|
||||||
|
|
||||||
Optional<Transaction> lastTransaction(long accountId, String source, String destination, Double amount);
|
Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount);
|
||||||
|
|
||||||
Collection<Account> listAccounts(long userId);
|
Collection<Account> listAccounts(long userId);
|
||||||
|
|
||||||
|
|||||||
@@ -311,11 +311,12 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
|||||||
var source = src.get(src.has(Field.ID) ? Field.ID : Field.DISPLAY).toString();
|
var source = src.get(src.has(Field.ID) ? Field.ID : Field.DISPLAY).toString();
|
||||||
if (!json.has(Field.DESTINATION)) throw missingField(Field.DESTINATION);
|
if (!json.has(Field.DESTINATION)) throw missingField(Field.DESTINATION);
|
||||||
if (!(json.get(Field.DESTINATION) instanceof JSONObject dst)) throw invalidField(Field.SOURCE,JSON);
|
if (!(json.get(Field.DESTINATION) instanceof JSONObject dst)) throw invalidField(Field.SOURCE,JSON);
|
||||||
String destination = dst.has(Field.ID) ? dst.get(Field.ID).toString() : dst.has(Field.DISPLAY) ? dst.get(Field.DISPLAY).toString() : null;
|
var dest = dst.get(dst.has(Field.ID) ? Field.ID : Field.DISPLAY).toString();
|
||||||
Double amount = null;
|
if (!json.has(Field.AMOUNT)) throw missingField(Field.AMOUNT);
|
||||||
if (json.has(Field.AMOUNT) && json.get(Field.AMOUNT) instanceof Number amt) amount = amt.doubleValue();
|
if (!(json.get(Field.AMOUNT) instanceof Number amt)) throw invalidField(Field.AMOUNT,Text.NUMBER);
|
||||||
|
var amount = amt.doubleValue();
|
||||||
|
|
||||||
var transaction = accountDb.lastTransaction(accountId, source, destination, amount);
|
var transaction = accountDb.lastTransaction(accountId, source, dest, amount);
|
||||||
return transaction.isPresent() ? sendContent(ex,transaction.get()) : notFound(ex);
|
return transaction.isPresent() ? sendContent(ex,transaction.get()) : notFound(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,42 +170,22 @@ public class SqliteDb extends BaseDb implements AccountDb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<Transaction> lastTransaction(long accountId, String source, String destination, Double amount) {
|
public Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount) {
|
||||||
try {
|
try {
|
||||||
var query = select(ALL).from(TABLE_TRANSACTIONS).where(ACCOUNT,equal(accountId));
|
var rs = select(ALL).from(TABLE_TRANSACTIONS)
|
||||||
if (source != null) query = query.where(SOURCE,equal(source));
|
.where(ACCOUNT,equal(accountId)).where(SOURCE,equal(source)).where(DESTINATION,equal(dest)).where(AMOUNT,equal(amount))
|
||||||
if (destination != null) query = query.where(DESTINATION,equal(destination));
|
.sort(ID+" DESC")
|
||||||
if (amount != null) query = query.where(AMOUNT,equal(amount));
|
.limit(1)
|
||||||
var rs = query.sort(ID+" DESC").limit(1).exec(db);
|
.exec(db);
|
||||||
Transaction ta = null;
|
Transaction ta = null;
|
||||||
if (rs.next()) ta = Transaction.of(rs);
|
if (rs.next()) ta = Transaction.of(rs);
|
||||||
rs.close();
|
rs.close();
|
||||||
|
|
||||||
if (ta == null && amount != null) { // try to search by amount, ignore source and dest
|
|
||||||
rs = select(ALL).from(TABLE_TRANSACTIONS).where(ACCOUNT, equal(accountId)).where(AMOUNT, equal(amount))
|
|
||||||
.sort(ID + " DESC").limit(1).exec(db);
|
|
||||||
if (rs.next()) ta = Transaction.of(rs);
|
|
||||||
rs.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ta == null && source != null && destination != null) { // try to search by amount, ignore source and dest
|
|
||||||
rs = select(ALL).from(TABLE_TRANSACTIONS)
|
|
||||||
.where(SOURCE,equal(source))
|
|
||||||
.where(DESTINATION,equal(destination))
|
|
||||||
.where(ACCOUNT, equal(accountId))
|
|
||||||
.sort(ID + " DESC").limit(1).exec(db);
|
|
||||||
if (rs.next()) ta = Transaction.of(rs);
|
|
||||||
rs.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (ta != null){
|
if (ta != null){
|
||||||
var tags = ta.tags();
|
var tags = ta.tags();
|
||||||
rs = select(TAG).from(TABLE_TAGS_TRANSACTIONS).leftJoin(TAG_ID,TABLE_TAGS,ID).where(TRANSACTION_ID,equal(ta.id())).exec(db);
|
rs = select(TAG).from(TABLE_TAGS_TRANSACTIONS).leftJoin(TAG_ID,TABLE_TAGS,ID).where(TRANSACTION_ID,equal(ta.id())).exec(db);
|
||||||
while (rs.next()) tags.add(rs.getString(1));
|
while (rs.next()) tags.add(rs.getString(1));
|
||||||
rs.close();
|
rs.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullable(ta);
|
return nullable(ta);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw failedToSearchDb(t(Text.ACCOUNTING));
|
throw failedToSearchDb(t(Text.ACCOUNTING));
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import de.srsoftware.umbrella.bookmarks.BookmarkApi;
|
|||||||
import de.srsoftware.umbrella.company.CompanyModule;
|
import de.srsoftware.umbrella.company.CompanyModule;
|
||||||
import de.srsoftware.umbrella.contact.ContactModule;
|
import de.srsoftware.umbrella.contact.ContactModule;
|
||||||
import de.srsoftware.umbrella.core.SettingsService;
|
import de.srsoftware.umbrella.core.SettingsService;
|
||||||
|
import de.srsoftware.umbrella.core.Util;
|
||||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
import de.srsoftware.umbrella.documents.DocumentApi;
|
import de.srsoftware.umbrella.documents.DocumentApi;
|
||||||
import de.srsoftware.umbrella.files.FileModule;
|
import de.srsoftware.umbrella.files.FileModule;
|
||||||
@@ -33,6 +34,7 @@ import de.srsoftware.umbrella.translations.Translations;
|
|||||||
import de.srsoftware.umbrella.user.UserModule;
|
import de.srsoftware.umbrella.user.UserModule;
|
||||||
import de.srsoftware.umbrella.web.WebHandler;
|
import de.srsoftware.umbrella.web.WebHandler;
|
||||||
import de.srsoftware.umbrella.wiki.WikiModule;
|
import de.srsoftware.umbrella.wiki.WikiModule;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import static java.lang.System.Logger.Level.*;
|
|||||||
import static java.lang.System.Logger.Level.WARNING;
|
import static java.lang.System.Logger.Level.WARNING;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
import com.xrbpowered.jparsedown.JParsedown;
|
||||||
import de.srsoftware.tools.Mappable;
|
import de.srsoftware.tools.Mappable;
|
||||||
import de.srsoftware.tools.Query;
|
import de.srsoftware.tools.Query;
|
||||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
@@ -31,6 +32,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
{#if messages.warning}
|
{#if messages.warning}
|
||||||
<span class="warn">{@html messages.warning}</span>
|
<span class="warn">{@html messages.warning}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<Route path="/" component={User} />
|
<Route path="/" component={ProjectList} />
|
||||||
<Route path="/account/:id" component={Account} />
|
<Route path="/account/:id" component={Account} />
|
||||||
<Route path="/accounting" component={Accounts} />
|
<Route path="/accounting" component={Accounts} />
|
||||||
<Route path="/accounting/new" component={NewAccount} />
|
<Route path="/accounting/new" component={NewAccount} />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import { error, yikes } from '../../warn.svelte';
|
import { error, yikes } from '../../warn.svelte';
|
||||||
import { t } from '../../translations.svelte';
|
import { t } from '../../translations.svelte';
|
||||||
|
|
||||||
import EntryForm from './add_entry_new.svelte';
|
import EntryForm from './add_entry.svelte';
|
||||||
import Transaction from './transaction.svelte';
|
import Transaction from './transaction.svelte';
|
||||||
|
|
||||||
let { id } = $props();
|
let { id } = $props();
|
||||||
@@ -163,5 +163,5 @@
|
|||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<EntryForm {account} {onSave} {users} />
|
<EntryForm {account} {onSave} />
|
||||||
{/if}
|
{/if}
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
|
||||||
|
|
||||||
import { t } from '../../translations.svelte';
|
|
||||||
import { api, post } from '../../urls.svelte';
|
|
||||||
import { error, yikes } from '../../warn.svelte';
|
|
||||||
import { user } from '../../user.svelte';
|
|
||||||
import Autocomplete from '../../Components/Autocomplete.svelte';
|
|
||||||
import Tags from '../tags/TagList.svelte';
|
|
||||||
|
|
||||||
let defaultAccount = {
|
|
||||||
id : 0,
|
|
||||||
name : '',
|
|
||||||
currency : ''
|
|
||||||
};
|
|
||||||
let { account = defaultAccount, new_account = false, onSave = () => {}, users } = $props();
|
|
||||||
|
|
||||||
let entry = $state({
|
|
||||||
account,
|
|
||||||
date : new Date().toISOString().substring(0, 10),
|
|
||||||
source : {
|
|
||||||
display: user.name,
|
|
||||||
id: user.id
|
|
||||||
},
|
|
||||||
destination : {},
|
|
||||||
amount : 0.0,
|
|
||||||
purpose : {},
|
|
||||||
tags : []
|
|
||||||
});
|
|
||||||
let router = useTinyRouter();
|
|
||||||
|
|
||||||
async function dst_selected(destination){
|
|
||||||
destination = JSON.parse(JSON.stringify(destination));
|
|
||||||
let source = JSON.parse(JSON.stringify(entry.source));
|
|
||||||
const url = api(`accounting/${entry.account.id}/tags`)
|
|
||||||
const res = await post(url,{source,destination});
|
|
||||||
if (res.ok) {
|
|
||||||
yikes();
|
|
||||||
const json = await res.json();
|
|
||||||
await proposePurpose();
|
|
||||||
entry.tags = json;
|
|
||||||
} else error(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
function focusOnEnter(ev,id){
|
|
||||||
if (ev.key == 'Enter') {
|
|
||||||
proposePurpose();
|
|
||||||
document.getElementById(id).focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAccountTags(text){
|
|
||||||
if (!text) return [];
|
|
||||||
const url = api(`accounting/${entry.account.id}/tags`)
|
|
||||||
return await getProposals(text,url);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getDestinations(text){
|
|
||||||
const url = api('accounting/destinations');
|
|
||||||
return await getProposals(text,url);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getProposals(text,url){
|
|
||||||
const res = await post(url,text);
|
|
||||||
if (res.ok){
|
|
||||||
yikes();
|
|
||||||
const input = await res.json();
|
|
||||||
return Object.values(input).map(mapDisplay);
|
|
||||||
} else {
|
|
||||||
error(res);
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async function getPurposes(text) {
|
|
||||||
const url = api('accounting/purposes');
|
|
||||||
return await getProposals(text,url);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getSources(text){
|
|
||||||
const url = api('accounting/sources');
|
|
||||||
return await getProposals(text,url);
|
|
||||||
}
|
|
||||||
|
|
||||||
function gotoTags(purpose){
|
|
||||||
document.getElementById('new_tag_input');
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapDisplay(object){
|
|
||||||
if (object.display){
|
|
||||||
return object;
|
|
||||||
} else if (object.name) {
|
|
||||||
return {...object, display: object.name};
|
|
||||||
} else {
|
|
||||||
return { display : object }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function proposePurpose(){
|
|
||||||
console.log('proposePurpose()');
|
|
||||||
const amount = entry.amount;
|
|
||||||
const source = entry.source;
|
|
||||||
const destination = entry.destination;
|
|
||||||
const url = api(`accounting/${account.id}/purposes`);
|
|
||||||
const res = await post(url,{source,destination,amount});
|
|
||||||
if (res.ok) {
|
|
||||||
yikes();
|
|
||||||
var lastTransaction = await res.json();
|
|
||||||
console.log({lastTransaction,users:JSON.parse(JSON.stringify(users))});
|
|
||||||
entry.purpose = { display: lastTransaction.purpose};
|
|
||||||
entry.tags = lastTransaction.tags;
|
|
||||||
if (lastTransaction.source.value){
|
|
||||||
if (users[lastTransaction.source.value]){
|
|
||||||
let user = users[lastTransaction.source.value];
|
|
||||||
entry.source = { id : +lastTransaction.source.value, display : user.name };
|
|
||||||
} else entry.source = { display: lastTransaction.source.value };
|
|
||||||
}
|
|
||||||
if (lastTransaction.destination.value){
|
|
||||||
if (users[lastTransaction.destination.value]){
|
|
||||||
let user = users[lastTransaction.destination.value];
|
|
||||||
entry.destination = { id : +lastTransaction.destination.value, display : user.name };
|
|
||||||
} else entry.destination = { display: lastTransaction.destination.value };
|
|
||||||
}
|
|
||||||
} else error(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function save(){
|
|
||||||
let data = {
|
|
||||||
...entry,
|
|
||||||
purpose: entry.purpose.display
|
|
||||||
}
|
|
||||||
let url = api('accounting');
|
|
||||||
let res = await post(url, data);
|
|
||||||
if (res.ok) {
|
|
||||||
yikes();
|
|
||||||
if (new_account){
|
|
||||||
router.navigate('/accounting');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//entry.tags = [];
|
|
||||||
onSave();
|
|
||||||
document.getElementById('date-input').focus();
|
|
||||||
} else error(res);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
hr{
|
|
||||||
grid-column: 1 / -1;
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
border: 0;
|
|
||||||
height: 1px;
|
|
||||||
align-self: center;
|
|
||||||
background: red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<fieldset class="grid2 new_transaction">
|
|
||||||
{#if new_account}
|
|
||||||
<legend>{t('create_new_object',{object:t('account')})}</legend>
|
|
||||||
<span style="display:none"></span>
|
|
||||||
<span>{t('account name')}</span>
|
|
||||||
<span>
|
|
||||||
<input type="text" bind:value={entry.account.name} />
|
|
||||||
</span>
|
|
||||||
<span>{t('currency')}</span>
|
|
||||||
<span>
|
|
||||||
<input type="text" bind:value={entry.account.currency} />
|
|
||||||
</span>
|
|
||||||
<hr/>
|
|
||||||
<span style="grid-column-end: span 2">{t('first transaction')}</span>
|
|
||||||
{:else}
|
|
||||||
<legend>{t('add_object',{object:t('transaction')})}</legend>
|
|
||||||
<span style="display:none"></span>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<span>{t('date')}</span>
|
|
||||||
<span>
|
|
||||||
<input type="date" bind:value={entry.date} id="date-input" />
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span>{t('amount')}</span>
|
|
||||||
<span>
|
|
||||||
<input type="number" bind:value={entry.amount} onkeyup={e => focusOnEnter(e,'source-input')} /> {entry.account.currency}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span>{t('source')}</span>
|
|
||||||
<Autocomplete bind:candidate={entry.source} getCandidates={getSources} id="source-input" />
|
|
||||||
|
|
||||||
<span>{t('destination')}</span>
|
|
||||||
<Autocomplete bind:candidate={entry.destination} getCandidates={getDestinations} onSelect={dst_selected} />
|
|
||||||
|
|
||||||
|
|
||||||
<span>{t('purpose')}</span>
|
|
||||||
<Autocomplete bind:candidate={entry.purpose} getCandidates={getPurposes} onCommit={gotoTags} id="purpose_input" />
|
|
||||||
|
|
||||||
<span>{t('tags')}</span>
|
|
||||||
<Tags getCandidates={getAccountTags} module={null} bind:tags={entry.tags} onEmptyCommit={save} />
|
|
||||||
|
|
||||||
<span></span>
|
|
||||||
<span>
|
|
||||||
<button onclick={save}>{t('save')}</button>
|
|
||||||
</span>
|
|
||||||
</fieldset>
|
|
||||||
@@ -44,9 +44,9 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{#each accounts as account (account.id)}
|
{#each accounts.toSorted((a,b) => a.name.localeCompare(b.name)) as account (account.id)}
|
||||||
<li>
|
<li>
|
||||||
<a {onclick} href="/account/{account.id}">{account.name} ({account.id})</a>
|
<a {onclick} href="/account/{account.id}">{account.name}</a>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
<legend>{t('state_open')}</legend>
|
<legend>{t('state_open')}</legend>
|
||||||
{#if sorted}
|
{#if sorted}
|
||||||
{#each sorted as task}
|
{#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} >
|
<div href={`/task/${task.id}/view`} title={task.description.source} task_id={task.id} {onclick} {oncontextmenu} {ontouchstart} {ontouchend} onmousedown={ontouchstart} onmouseup={ontouchend} >
|
||||||
{task.name}
|
{task.name}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
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 { error, yikes } from '../../warn.svelte';
|
||||||
import { t } from '../../translations.svelte.js';
|
import { t } from '../../translations.svelte.js';
|
||||||
import { timetrack } from '../../user.svelte.js';
|
import { timetrack } from '../../user.svelte.js';
|
||||||
@@ -41,10 +41,18 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function addTime(task_id){
|
async function addTime(task_id){
|
||||||
const url = api(`time/track_task/${task_id}`);
|
let url = api(`time/track_task/${task_id}`);
|
||||||
const resp = await post(url,now()); // create new time or return time with assigned tasks
|
let resp = await post(url,now()); // create new time or return time with assigned tasks
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
const track = await resp.json();
|
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;
|
timetrack.running = track;
|
||||||
} else {
|
} else {
|
||||||
error(resp);
|
error(resp);
|
||||||
|
|||||||
@@ -14,8 +14,11 @@ import de.srsoftware.configuration.Configuration;
|
|||||||
import de.srsoftware.tools.Path;
|
import de.srsoftware.tools.Path;
|
||||||
import de.srsoftware.umbrella.core.BaseHandler;
|
import de.srsoftware.umbrella.core.BaseHandler;
|
||||||
import de.srsoftware.umbrella.core.ModuleRegistry;
|
import de.srsoftware.umbrella.core.ModuleRegistry;
|
||||||
|
import de.srsoftware.umbrella.core.Util;
|
||||||
import de.srsoftware.umbrella.core.api.MarkdownService;
|
import de.srsoftware.umbrella.core.api.MarkdownService;
|
||||||
|
import de.srsoftware.umbrella.core.constants.Field;
|
||||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|||||||
@@ -79,8 +79,15 @@ public class TimeModule extends BaseHandler implements TimeService {
|
|||||||
if (user.isEmpty()) return unauthorized(ex);
|
if (user.isEmpty()) return unauthorized(ex);
|
||||||
var head = path.pop();
|
var head = path.pop();
|
||||||
return switch (head) {
|
return switch (head) {
|
||||||
case STARTED -> getStartedTime(user.get(),ex);
|
case STARTED -> getStartedTime(user.get(),ex);
|
||||||
case null, default -> super.doGet(path,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){
|
} catch (UmbrellaException e){
|
||||||
return send(ex,e);
|
return send(ex,e);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"abort": "abbrechen",
|
"abort": "abbrechen",
|
||||||
"account": "Konto",
|
"account": "Konto",
|
||||||
"accounting": "Konten",
|
"accounting": "Konten",
|
||||||
|
"account name": "Konto-Name",
|
||||||
"accounts": "Konten",
|
"accounts": "Konten",
|
||||||
"actions": "Aktionen",
|
"actions": "Aktionen",
|
||||||
"add_login_service": "Login-Service anlegen",
|
"add_login_service": "Login-Service anlegen",
|
||||||
@@ -75,6 +76,7 @@
|
|||||||
"CREATE_USERS": "Nutzer anlegen",
|
"CREATE_USERS": "Nutzer anlegen",
|
||||||
"create_pdf": "PDF erzeugen",
|
"create_pdf": "PDF erzeugen",
|
||||||
"created_with": "erzeugt mit {tool} von {producer}",
|
"created_with": "erzeugt mit {tool} von {producer}",
|
||||||
|
"currency": "Währung",
|
||||||
"customer": "Kunde",
|
"customer": "Kunde",
|
||||||
"customer_address": "Adresse",
|
"customer_address": "Adresse",
|
||||||
"customer_email": "Emailadresse des Kunden",
|
"customer_email": "Emailadresse des Kunden",
|
||||||
@@ -162,6 +164,7 @@
|
|||||||
"files": "Dateien",
|
"files": "Dateien",
|
||||||
"filter": "Filter",
|
"filter": "Filter",
|
||||||
"filter by tags": "Nach Tags filtern",
|
"filter by tags": "Nach Tags filtern",
|
||||||
|
"first_transaction": "erste Transaktion",
|
||||||
"footer": "Fuß-Text",
|
"footer": "Fuß-Text",
|
||||||
"foreign_id": "externe Kennung",
|
"foreign_id": "externe Kennung",
|
||||||
"forgot_pass" : "Password vergessen?",
|
"forgot_pass" : "Password vergessen?",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"abort": "abort",
|
"abort": "abort",
|
||||||
"account": "account",
|
"account": "account",
|
||||||
"accounting": "accounting",
|
"accounting": "accounting",
|
||||||
|
"account name": "Account name",
|
||||||
"accounts": "accounts",
|
"accounts": "accounts",
|
||||||
"actions": "actions",
|
"actions": "actions",
|
||||||
"add_login_service": "add login service",
|
"add_login_service": "add login service",
|
||||||
@@ -75,6 +76,7 @@
|
|||||||
"CREATE_USERS": "create users",
|
"CREATE_USERS": "create users",
|
||||||
"create_pdf": "create PDF",
|
"create_pdf": "create PDF",
|
||||||
"created_with": "created with {tool} by {producer}",
|
"created_with": "created with {tool} by {producer}",
|
||||||
|
"currency": "Currency",
|
||||||
"customer": "customer",
|
"customer": "customer",
|
||||||
"customer_address": "address",
|
"customer_address": "address",
|
||||||
"customer_email": "customer email address",
|
"customer_email": "customer email address",
|
||||||
@@ -162,6 +164,7 @@
|
|||||||
"files": "files",
|
"files": "files",
|
||||||
"filter": "filter",
|
"filter": "filter",
|
||||||
"filter by tags": "filter by tags",
|
"filter by tags": "filter by tags",
|
||||||
|
"first_transaction": "first transaction",
|
||||||
"footer": "footer",
|
"footer": "footer",
|
||||||
"foreign_id": "external ID",
|
"foreign_id": "external ID",
|
||||||
"forgot_pass" : "forgot password?",
|
"forgot_pass" : "forgot password?",
|
||||||
@@ -459,11 +462,11 @@
|
|||||||
"wiki_pages": "wiki pages",
|
"wiki_pages": "wiki pages",
|
||||||
|
|
||||||
"year": "year",
|
"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}": "You can view/edit this transaction at {base_url}/account/{id}",
|
||||||
"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 project at {base_url}/project/{id}/view": "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 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 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 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 .",
|
"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 token to create a new password" : "Your token to create a new password",
|
||||||
"your_profile": "your profile"
|
"your_profile": "your profile"
|
||||||
|
|||||||
Reference in New Issue
Block a user