diff options
| author | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-04 12:36:52 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-04 12:36:52 +0100 |
| commit | 9a3cfd077013e42d4b3f788b78f45edf3b46ef07 (patch) | |
| tree | 96f36ba34e47ef3d757d341f7f30d1492eca70e0 /include | |
| parent | 66a918a4621f1ecb828e68eac94fdb34852e9570 (diff) | |
activity list write
Diffstat (limited to 'include')
| -rw-r--r-- | include/administration.hpp | 7 | ||||
| -rw-r--r-- | include/administration_writer.hpp | 11 | ||||
| -rw-r--r-- | include/file_templates.hpp | 8 |
3 files changed, 14 insertions, 12 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index d899987..1fac81c 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -424,9 +424,7 @@ typedef struct time_t timestamp; char user_name[MAX_LEN_SHORT_DESC]; char ref_id[MAX_LEN_ID]; - char message[MAX_LEN_LONG_DESC]; - char params[ACTIVITY_MAX_PARAMS][MAX_LEN_LONG_DESC]; } activity; typedef struct @@ -627,7 +625,8 @@ namespace administration { // Activity functions. // =================== - a_err activity_add(char* user, char* ref_id, char* message, ...); + a_err activity_add(char* user, char* ref_id, char* message); u32 activity_get_all_for_object(activity* buffer, char* ref_id); - + u32 activity_count(); + a_err activity_get_by_index(u32 index, activity* buffer); }
\ No newline at end of file diff --git a/include/administration_writer.hpp b/include/administration_writer.hpp index 488330b..81630a7 100644 --- a/include/administration_writer.hpp +++ b/include/administration_writer.hpp @@ -18,7 +18,8 @@ #include "administration.hpp" -#define ADMIN_FILE_INFO "info.xml" +#define ACTIVITY_FILE "activities.xml" +#define ADMIN_INFO_FILE "info.xml" typedef void (*write_completed_event)(); @@ -33,20 +34,14 @@ namespace administration_writer { bool create(); void destroy(); - bool start_new(); - - // Individual entity writing. bool delete_entry(const char* id); bool save_project_blocking(project project); bool save_cost_center_blocking(cost_center cost); bool save_tax_rate_blocking(tax_rate rate); bool save_contact_blocking(contact c); bool save_invoice_blocking(invoice inv); - - // Archiving functions. bool save_administration_info_blocking(); bool save_all_tax_rates_blocking(); bool save_all_cost_centers_blocking(); - bool save_all_async(); - + bool save_activities_blocking(); }
\ No newline at end of file diff --git a/include/file_templates.hpp b/include/file_templates.hpp index 5404270..ec78cb7 100644 --- a/include/file_templates.hpp +++ b/include/file_templates.hpp @@ -130,6 +130,14 @@ namespace file_template { "<InvoiceExtras>\n" " <Status>{{INVOICE_STATUS}}</Status>\n" "</InvoiceExtras>\n"; + + static const char *activity_template = + "<Activity>\n" + " <Timestamp>{{TIMESTAMP}}</Timestamp>\n" + " <User>{{USERNAME}}</User>\n" + " <RefId>{{REF_ID}}</RefId>\n" + " <Message>{{MESSAGE}}</Message>\n" + "</Activity>\n"; static const char *peppol_invoice_template = /*"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"*/ |
