159 Commits

Author SHA1 Message Date
Thomas Gelf
2cff396fe4 DbDataFormatter: new helper class
Trying to reduce logic in IcingaObject
2021-05-20 16:21:46 +02:00
Thomas Gelf
36141c5f98 Import: validated encoding on DB error
MySQL gives useless error messages for invalid UTF8 characters and
confuses users with an 'Invalid datetime format' message.

Once storing imported data fails, the original data will now be scanned
for invalid UTF-8 characters. If such are found, a dedicated exception
with more details is thrown. Otherwise the original exception will be
forwarded

fixes #2143
2020-07-10 17:16:08 +02:00
Thomas Gelf
15b52a323c AssignFilterHelper: fix error message 2020-02-12 14:52:03 +01:00
Thomas Gelf
2ef30f5f12 various: formatting, cleanup 2020-01-10 12:33:54 +01:00
Thomas Gelf
2e29188020 DbObject: logId should show autoinc id in case...
...nothing else is present
2019-09-20 03:39:12 +02:00
Thomas Gelf
a93d743e8c DbObjectWithSettings: also call setter if just...
...a setter and no getter exists
2019-09-19 23:27:53 +02:00
Thomas Gelf
10be27c9a3 DbObject: provide methods checking for getters...
...and setters
2019-09-19 23:27:06 +02:00
Thomas Gelf
1e893e1bc7 DbObject: make key name obvious when setting...
...an invalid property
2019-09-16 10:45:14 +02:00
Thomas Gelf
f9ee098f06 ArrayCustomVariablesFilter: accept lists with...
..."Array" target data type

fixes #1241
2019-06-11 11:39:54 +02:00
Markus Frosch
4037e22709 Implement AssignFilterHelper to improve apply/assign matching
* is set / is not set - fixes #1483 fixes #1387
* case-insensitive matching when using wildcards '*'
  like match() in Icinga 2
2019-05-06 14:19:29 +02:00
Thomas Gelf
b644a7c6a7 IcingaObject, ..WithSettings: fix Basket-related..
...problems
2018-11-26 00:12:13 +01:00
Thomas Gelf
6377ed61cc DbObject: remove binary column magic
Binary columns must be configured explicitly, binary keys are now also
possible

fixes #1702
2018-11-14 12:24:31 +01:00
Thomas Gelf
75787911b5 DbObject: fix insert with unprotected autoinc...
...for PostgreSQL
2018-10-15 15:03:57 +02:00
Thomas Gelf
affcc54ba3 DbObject: allow specific objects to change their
...autoinc ID
2018-10-15 15:03:57 +02:00
Thomas Gelf
6adc0f7632 DbObjectWithSettings: make sure new ones are...
...sorted
2018-10-15 15:03:57 +02:00
Thomas Gelf
ad46ff9fb0 DbObject: cleanup, phpdoc 2018-10-04 06:49:19 +02:00
Markus Frosch
0911910856 DbObject: Don't allow empty id for multi-column objects
This avoids that the user can actually create duplicate objects in the
database. (E.g. for service templates)
2018-09-05 11:41:49 +02:00
Thomas Gelf
31b2326e1e DbObjectWithSettings: fix for unstored objects 2018-07-13 10:56:51 +02:00
Thomas Gelf
98099ad48a DbObjectWithSettings: allow to pass objects 2018-06-11 16:48:20 +02:00
Thomas Gelf
927591501c Export: first bunch of exportable Director objects
ImportSource, SyncRule, Datafield and more

refs #1409
2018-06-01 18:44:07 +02:00
Thomas Gelf
a005ac3228 IcingaCommand: pathes prefixed with Windows ENV
...variables are considered to be absolute

fixes #1469
2018-06-01 11:38:28 +02:00
Thomas Gelf
8c432285e7 Various: stick with default exceptions...
...IDE hints are annoying
2018-05-29 21:31:43 +02:00
Thomas Gelf
02dfac1b8b Revert "Export: first bunch of exportable Director objects"
Wrong branch, not yet for the master

This reverts commit 721700c62f305e23130d20926ee1b8bc55bc824c.
2018-05-29 12:40:14 +02:00
Thomas Gelf
721700c62f Export: first bunch of exportable Director objects
ImportSource, SyncRule, Datafield and more

refs #1409
2018-05-29 12:34:18 +02:00
Thomas Gelf
4f8c60bb46 various: cleanup, sop using deprecated methods 2018-05-05 00:24:49 +02:00
Thomas Gelf
92535ab702 DbConnection: add isMysql() helper method 2018-03-28 17:49:59 +02:00
Thomas Gelf
d5fe207efd DbObjectWithSettings: sort settings by name 2018-02-25 18:06:12 +01:00
Thomas Gelf
45209b99c3 DbObject: remove useless property 2018-02-25 17:45:17 +01:00
Thomas Gelf
8f7e9e9ecd Sync: do not touch 'disabled' on merge unless...
...it has been defined as a Sync Property

fixes #1223
2017-10-10 16:32:57 +02:00
Thomas Gelf
e76665741e ImportSourceSql: cache query column list
fixes #1071
2017-09-11 15:30:00 +02:00
Thomas Gelf
2109d138d5 IcingaTimeperiodRangeForm: delete through the...
IcingaTimePeriod and it's Ranges

fixes #1089
2017-08-21 22:41:37 +02:00
Thomas Gelf
4f38a39e14 DbObject: better IDE hint 2017-08-20 16:04:46 +02:00
Thomas Gelf
41aa86188f DbObjectWithSettings: no return value for __unset 2017-08-20 15:33:43 +02:00
Thomas Gelf
74a887f5af DirectorObjectForm: fix redirectionUrl for...
...objects without id

fixes #1043
2017-07-28 22:40:16 +02:00
Peter Backes
bec8ef1ac2 DbObject: Don't confuse ids and object_names
fixes #992
2017-07-14 13:21:42 +02:00
Thomas Gelf
180fc2ccfa Datafield: on rename ask whether to also rename vars
fixes #818
2017-07-14 13:21:42 +02:00
Thomas Gelf
e0589d3560 DbObject: allow to instantiate from Db row...
...even from outside. This breaks some legacy principles, but this class is
going to be separated into multiple components anyways. Also allow to directly
get a specific property
2017-07-14 13:21:42 +02:00
Thomas Gelf
b7a10d296c phpcs: mostly new PSR-2 SpacingAfter/Before checks 2017-01-13 20:54:52 +01:00
Thomas Gelf
9e771f2d5a Fix phpcs complaints 2017-01-13 19:47:54 +01:00
Thomas Gelf
4a75804d86 various: change icinga.org to icinga.com
fixes #14001
2017-01-13 13:33:58 +01:00
Thomas Gelf
ec0cbac657 ObjectQuery, FilterRenderer: two new classes...
...required when working with the cache

refs #13068
2016-12-16 12:19:57 +01:00
Markus Frosch
ab169e4b78 DbObject: Add and use DuplicateKeyException 2016-11-28 15:32:41 +01:00
Thomas Gelf
87fe623d11 DbObject: help IDE, render newline after a...
...disabled v1 object
2016-11-04 19:52:21 +01:00
Thomas Gelf
ef9ef52124 IcingaService: provide assignment properties
fixes #12731
fixes #13038
fixes #12073
2016-11-03 16:35:27 +01:00
Thomas Gelf
ee0def7d2b Lots of files: make IDE users happy 2016-11-01 18:28:36 +01:00
Thomas Gelf
5921f4773f DbObject: one more protection when looking up...
...prefetched objects by name
2016-10-27 19:34:11 +00:00
Thomas Gelf
5b4e7509f4 Just a couple of phpcs complaints fixed 2016-10-22 06:08:52 +00:00
Corentin Ardeois
e7bd4343b5 Add support for Apply for rules in services
Apply for rules are defined through `apply_for` property
Only Array custom variables will be eligible in apply_for dropdown.

API Example:
```bash
 ./director-curl POST director/service?name=my_service '{"apply_for": "for (checked_tcp_port in host.vars.checked_tcp_ports)" }'
 ```

 Will render as:
 ```
  apply Service "my_service" for (checked_tcp_port in host.vars.checked_tcp_ports) {
      ...
  }
  ```
Feature: https://dev.icinga.org/issues/11976

Depends-On: https://github.com/Icinga/icingaweb2-module-director/pull/20
refs #11976
2016-10-22 06:00:54 +00:00
Thomas Gelf
42aef0105d DbObject: exists() should respect prefetch...
...also for negative lookups

refs #12876
2016-10-08 19:34:59 +00:00
Thomas Gelf
749f035971 Db/IcingaObject: formatting & style 2016-10-05 18:05:59 +00:00