Wiki-Quellcode von timerecording/get_costcenters.php
Zuletzt geändert von YellowFox_RD am 2025/01/20 15:37
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
1 | (% class="box" %) | ||
2 | (((Inhaltsverzeichnis))) | ||
3 | {{toc/}} | ||
4 | |||
5 | (% class="box" %) | ||
6 | ((( | ||
7 | **Kompatibilität | ||
8 | **Diese Funktion ist nur für Kunden mit aktivierter Zeiterfassung V3 verfügbar. | ||
9 | ))) | ||
10 | |||
11 | Gibt alle aktuell verfügbaren Kostenstellen der Zeiterfassung zurück. | ||
12 | = Beschreibung = | ||
13 | **(% class="green mark" %)GET(%%) //timerecording/get_costcenters.php?company//**//=COMPANY_RTIKEY**&import**=COMPANY_IMPORTKEY**&format**=FORMAT_TYPE// | ||
14 | = Parameter = | ||
15 | |=Parameter|=Beschreibung|=Typ|=Hinweis|=Pflicht | ||
16 | |company|RTI Firmenschlüssel|string||ja | ||
17 | |import|RTI Importschlüssel|string||ja | ||
18 | |format|Ausgabeformat|string|zulässige Ausgabeformate | ||
19 | ((( | ||
20 | * csv | ||
21 | * json | ||
22 | * xml | ||
23 | ))) | ||
24 | Standard ist csv.|nein | ||
25 | |||
26 | = Rückgabe = | ||
27 | Es wird ein **string** zurückgegeben. Im Fehlerfall wird "(% class="error" %)**ERROR:Beschreibung**(%%)". | ||
28 | == JSON Format == | ||
29 | Gibt einen JSON Formatierten Text zurück mit den Eigenschaften jeder Kostenstelle. | ||
30 | === Beispiel Ausgabe === | ||
31 | **JSON Ausgabe** | ||
32 | {{code language="js"}}[{ | ||
33 | ident: 'K1001', | ||
34 | name: 'Baustelle B', | ||
35 | valid_from: '2021-01-01', | ||
36 | valid_to: null, | ||
37 | planned_duration: 20000, | ||
38 | defined_activities: [ | ||
39 | { ident: 'A100', duration: 18000 }, | ||
40 | { ident: 'A200', duration: 2000 }, | ||
41 | { ident: 'A200', duration: null } | ||
42 | ], | ||
43 | allow_other_activities: 0, | ||
44 | defined_persons: [ | ||
45 | { id: '2093', name:'Max Mustermann' } | ||
46 | ] | ||
47 | }]{{/code}} | ||
48 | |||
49 | == XML Format == | ||
50 | Gibt einen XML Formatierten Text zurück mit den Eigenschaften jeder Kostenstelle. | ||
51 | === Beispiel Ausgabe === | ||
52 | **XML Ausgabe** | ||
53 | {{code language="xml"}}<?xml version="1.0" encoding="UTF-8"?> | ||
54 | <costcenters> | ||
55 | <costcenter> | ||
56 | <defined_activities> | ||
57 | <activity> | ||
58 | <duration>18000</duration> | ||
59 | <ident>A100</ident> | ||
60 | </activity> | ||
61 | <activity> | ||
62 | <duration>2000</duration> | ||
63 | <ident>A200</ident> | ||
64 | </activity> | ||
65 | <activity> | ||
66 | <duration null="true" /> | ||
67 | <ident>A200</ident> | ||
68 | </activity> | ||
69 | </defined_activities> | ||
70 | <allow_other_activities>0</allow_other_activities> | ||
71 | <ident>K1001</ident> | ||
72 | <name>Baustelle B</name> | ||
73 | <defined_persons> | ||
74 | <person> | ||
75 | <id>2093</ident> | ||
76 | <name>Max Mustermann</name> | ||
77 | </person> | ||
78 | </defined_persons> | ||
79 | <planned_duration>20000</planned_duration> | ||
80 | <valid_from>2021-01-01</valid_from> | ||
81 | <valid_to null="true" /> | ||
82 | </costcenter> | ||
83 | <costcenters>{{/code}} | ||
84 | |||
85 | == CSV Format == | ||
86 | Das CSV Format enthält eine Zeile pro Kostenstelle. Felder die mehrere Datensätze enthalten können, werden als JSON String ausgegeben. | ||
87 | === Metainformationen === | ||
88 | |=Trennzeichen|Semikolon ( ; ) | ||
89 | |=Textbegrenzer|Doppeltes Hochkomma ( " ) | ||
90 | |=Zeilenende|0x0D 0x0A (CarriageReturn LineFeed) | ||
91 | |=Header|Zeile 1 | ||
92 | |=Kodierung|UTF-8 | ||
93 | |||
94 | === CSV Spalten === | ||
95 | |=Spalte|=Beschreibung|= | ||
96 | |ident|//optional// selbst definierter Identifikator der Kostenstelle|Einstellbar über die allgemeinen Daten der Kostenstelle. | ||
97 | |name|selbst definierter Name der Kostenstelle| | ||
98 | |valid_from|Datum seit wann diese Kostenstelle aktiv ist|Format: YYYY-mm-dd | ||
99 | |valid_to|//optional// Datum bis wann diese Kostenstelle aktiv ist|Format: YYYY-mm-dd | ||
100 | |planned_duration|//optional// geplante Dauer der Kostenstelle|in Minuten | ||
101 | |defined_activities|//optional// festgelegte Tätigkeiten für diese Kostenstelle|Format: JSON String | ||
102 | |allow_other_activities|Option die festlegt ob neben den festgelegten Tätigkeiten auch andere Tätigkeiten auf diese Kostenstelle gebucht werden dürfen.|Format: 0 oder 1 | ||
103 | |defined_persons|//optional// festgelegte Personen für diese Kostenstelle|Format: JSON String | ||
104 | |||
105 | === Beispiel Ausgabe === | ||
106 | **Ausgabe in CSV** | ||
107 | {{code language="java"}}"ident";"name";"valid_from"";valid_to";"planned_duration";"defined_activities";"allow_other_activities";"defined_persons" | ||
108 | "K1001";"Baustelle B";"2021-01-01";"";"20000";"[{ ident: 'A100', duration: 18000 },{ ident: 'A200', duration: 2000 },{ ident: 'A200', duration: null }]";"0";"[{id:'2093',name:'Max Mustermann'}]"{{/code}} | ||
109 | |||
110 | = Beispiele = | ||
111 | **Kostenstellen im CSV Format** | ||
112 | {{code language="java"}}https://map.yellowfox.de/rti/timerecording/get_costcenters.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&format=csv{{/code}} | ||
113 |