Commit Graph

584 Commits

Author SHA1 Message Date
Matthias Jentsch 27960fc628 Catch exceptions in MenuItemRenderers
fixes #7157
2014-09-10 14:38:11 +02:00
Johannes Meyer 83772c6684 Merge branch 'master' into bugfix/rebuild-form-builder-5525 2014-09-09 16:03:22 +02:00
Matthias Jentsch 71f55e388f Only display custom menu renders on XHR requests and not in regular HTML
The main navigation should be rendered without a working backend.

fixes #7143
2014-09-09 15:33:42 +02:00
Johannes Meyer e7c021845d Simplify subform usage
refs #5525
2014-09-09 15:00:33 +02:00
Johannes Meyer f7f6bcc447 Make Form base class more test friendly..
refs #5525
2014-09-09 09:31:15 +02:00
Johannes Meyer c8ce1088c9 Disable checking whether a form is sent when form identification is disabled
refs #5525
2014-09-09 09:30:33 +02:00
Matthias Jentsch a352131d65 Move charts.less into widgets.less
Don't use a separate less file for only two styles
2014-09-08 16:25:11 +02:00
Matthias Jentsch e8164c6da0 Show tooltips to describe menu badges 2014-09-08 10:38:02 +02:00
Eric Lippmann 0e7ca591ec Merge branch 'master' into bugfix/commands-6593
Conflicts:
	application/forms/Preference/GeneralForm.php
	application/views/helpers/FormDateTime.php
	modules/monitoring/application/forms/Command/CommandForm.php
2014-09-08 10:16:05 +02:00
Matthias Jentsch e39dd64a1b Fix layout of HistoryColorGrid
Use actual color for critical hosts and only display the first two letters of the weekday
2014-09-08 09:52:28 +02:00
Johannes Meyer 12b4865559 Fix incompatible declaration of Form::setDefaults()
PHP with strict standards: Declaration of Icinga\Web\Form::setDefaults()
should be compatible with that of Zend_Form::setDefaults()

refs #5525
2014-09-08 09:42:02 +02:00
Johannes Meyer 930e6e7d71 We shouldn't require Form::createElements() to return self
refs #5525
2014-09-08 09:24:53 +02:00
Johannes Meyer ae9e5a40cc Merge branch 'master' into bugfix/rebuild-form-builder-5525
Conflicts:
	application/forms/Preference/GeneralForm.php
2014-09-08 08:46:53 +02:00
Thomas Gelf 4a89c2e163 Web\Hook: register('grapher') => GrapherHook 2014-09-05 18:54:50 +02:00
Matthias Jentsch 51d14af154 Merge branch 'master' into feature/navigation-unhandled-badges-7114
Conflicts:
	library/Icinga/Web/Menu.php
2014-09-05 18:14:29 +02:00
Matthias Jentsch 19eca5f50b Show all unhandled host and services in a menu
Add the option to define custom renderers for menu items and implement renderers to
display all unhandled services and host in a badge in the navigation.

resolves #7114
2014-09-05 17:57:20 +02:00
Thomas Gelf 596800bd7d helpers/url: overwrite existing params 2014-09-05 17:56:55 +02:00
Thomas Gelf 4bb065d9bb Web\Menu: provide and render unique id
fixes #7083
2014-09-05 17:24:55 +02:00
Thomas Gelf b034028ff8 Menu: do not show application log when none exists
Added new functions to the logger to get rid of distributed logging config
"knowledge".

fixes #7062
fixes #7098
2014-09-05 15:31:30 +02:00
Marius Hein 3ce42489c6 Timezone detection: Client implementation
refs #6078
2014-09-05 15:24:13 +02:00
Thomas Gelf e205ca4d0b FilterWidget: remove icon titles
fixes #7105
2014-09-05 14:50:22 +02:00
Thomas Gelf 33d2175b77 Web\UrlParams: allow to merge single value 2014-09-05 13:35:51 +02:00
Thomas Gelf baa775dd74 Web\Url: document with() method 2014-09-05 11:40:43 +02:00
Thomas Gelf 1c2207f51d Web\Url: provide a with() function 2014-09-05 11:21:10 +02:00
Thomas Gelf 4c8407e2b6 Web\StyleSheet: outer #layout access for modules
fixes #7093
2014-09-05 10:56:26 +02:00
Thomas Gelf b14e7f5696 LessCompiler: remove obsolete cache-related comment 2014-09-05 10:56:25 +02:00
Johannes Meyer fc72ddfbc8 Adjust Preferences/GeneralForm to use handleRequest() &. Co.
refs #5525
2014-09-05 10:21:24 +02:00
Johannes Meyer d021747bde Fix form widgets
refs #5525
2014-09-05 09:17:09 +02:00
Johannes Meyer 8846f17ae1 Make it possible to disable form identification
refs #5525
2014-09-05 09:16:09 +02:00
Alexander Fuhr ba623d0544 SearchDashboard: adjust SearchDashboardTest and rename searchQuery to searchString 2014-09-04 22:54:41 +02:00
Thomas Gelf 0f7f2f2d8b SearchDashboard: rename ::load() to ::search()
Function signature didn't match parent factory function

fixes #7081
2014-09-04 19:35:31 +02:00
Thomas Gelf 0f8d5bddba Web\Menu: make use of Web\Url
refs #7083
2014-09-04 19:18:09 +02:00
Thomas Gelf f91892cb80 Web\Url: add matches() function
fixes #6992
2014-09-04 18:46:58 +02:00
Alexander Fuhr e4d1143870 Add SearchDashboardTest 2014-09-04 18:31:08 +02:00
Alexander Fuhr 1eacde0233 Implement modules self provided search configuration
refs #6495
2014-09-04 16:31:10 +02:00
Marius Hein c8eaf66823 GrapherHook: Rework hook
refs #6932
2014-09-04 14:00:48 +02:00
Marius Hein 4fb47ef768 Hook classes: Add class suffix if not exist
refs #7066
refs #7067
refs #7068
2014-09-04 14:00:48 +02:00
Eric Lippmann c3c0043307 Merge branch 'master' into bugfix/commands-6593 2014-09-03 23:23:20 +02:00
Eric Lippmann a4da3b61b3 Merge branch 'bugfix/rebuild-form-builder-5525' into bugfix/commands-6593 2014-09-03 23:23:02 +02:00
Matthias Jentsch da85112538 Merge branch 'master' into feature/svg-chart-tooltips-7024 2014-09-03 17:08:00 +02:00
Matthias Jentsch 37b168995b Rename tipsy stylesheet file type to css and add license 2014-09-03 17:01:07 +02:00
Matthias Jentsch b10b1ea034 Add jQuery tooltips 2014-09-03 15:53:56 +02:00
Eric Lippmann 2025fb3a2f lib: Let the date-and-time input control behave as defined in HTML5
refs #6593
2014-09-03 14:40:58 +02:00
Alexander Fuhr acbd2bd7c0 Merge branch 'master' into feature/dashboard-component-disabled-property-6986 2014-09-03 14:40:30 +02:00
Eric Lippmann 906de4e679 lib: Add the HTML5 attributes 'min', 'max' and 'step' to the number input control
refs #6593
2014-09-03 14:39:42 +02:00
Eric Lippmann 1a4e908461 lib: Let `DateTimeValidator' validate values as defined in HTML5
See http://www.w3.org/TR/html-markup/datatypes.html#common.data.datetime for the specification.

refs #6593
2014-09-03 14:36:18 +02:00
Alexander Fuhr 7cfc051228 Add tests for Dashboard and fix doc blocks
refs #6986
2014-09-03 14:36:04 +02:00
Johannes Meyer 54a834266c Form::createElements() should add elements instead of returning them
In case createElements() would still return the elements while requiring
the caller to add them to the form all form dependent configurations get
lost. (displaygroups, belongTo, ...) Wizards or parent forms can still
retrieve only input relevant fields by just calling createElements() and
getElements().

refs #5525
2014-09-03 12:21:31 +02:00
Thomas Gelf 3d352ba446 Filter: add FilterNotEqual and FilterMatch
fixes #6557
2014-09-02 19:51:56 +02:00
Eric Lippmann 5485ca8a25 lib: Use Zend's `Int' validator in the `Number' form element
Further disabled default decorators since our form sets them.

refs #5525
2014-09-02 16:54:43 +02:00
Johannes Meyer 95c839a8bd Remove remaining usages of the ElementWrapper- and HelpText-Decorator
refs #5525
2014-09-02 16:50:59 +02:00
Thomas Gelf 6faedf5733 ActionController: no benchmark for no renderer
Benchmarks should not be shown when the renderer is no longer available.
2014-09-02 16:49:28 +02:00
Thomas Gelf e4687a60f9 Web\JavaScript: use Cache and ETags
refs #6927
2014-09-02 16:25:44 +02:00
Johannes Meyer 1ba3df310c Remove BaseConfigController, User\Message and Widget\AlertMesageBox
refs #6758
2014-09-02 16:25:03 +02:00
Johannes Meyer 539ab91ffa Add the FormErrors decorator as default decorator for forms
This allows us to use Zend_Form::addError() to show error messages for
the entire form context.

refs #5525
2014-09-02 16:25:03 +02:00
Thomas Gelf f0d6cf994e Web\StyleSheet: use Cache and ETags 2014-09-02 16:24:55 +02:00
Thomas Gelf ff6483cec5 Web\FileCache: initial implementation
refs #6927
2014-09-02 16:22:48 +02:00
Johannes Meyer 338f549233 Add class ReadablePathValidator 2014-09-02 16:19:45 +02:00
Johannes Meyer 39bb01b433 Rename Icinga\Web\Form::onShow() to onRequest()
onShow() is misleading because at the time this method is being called the
form is neither shown nor created.

refs #5525
2014-09-02 16:19:45 +02:00
Eric Lippmann d4c4ab7b2c lib/form: Fix default element decorators but breaking noscript layout
Replaced `ElementWrapper' and `HelpText' with Zend's `HtmlTag' and `Label' respectively.

Instances of Zend_Form_Element returned by `Form::createElements()' now receive our desired default decorators.

refs #5525
2014-09-02 15:23:07 +02:00
Eric Lippmann 8478ef3fce lib: Remove `HelpText' form element decorator
Zend already has a `Description' decorator.

refs #5525
2014-09-02 15:05:47 +02:00
Eric Lippmann 7143837ae3 lib: Remove `ElementWrapper' form element decorator
Zend has a `Label' decorator already.

refs #5525
2014-09-02 15:04:23 +02:00
Thomas Gelf 62c0f0be03 Web\Session: implement lazy loading
fixes #7055
2014-09-02 13:23:15 +02:00
Alexander Fuhr 26339b128a Add disabled property and implement the functionality
refs #6986
2014-09-02 13:16:21 +02:00
Alexander Fuhr bb0e1dc105 Revert "Fixes unaccepted behavior in module configuration"
This reverts commit 236d384bab.
2014-09-02 10:23:41 +02:00
Johannes Meyer cd8015f41a Pass the current form instance to the callback as second argument
refs #5525
2014-09-01 14:58:16 +02:00
Eric Lippmann 0822aff293 library/form: Fix return value of `getName()' not being filterd the first time it's called
`Form::getName()' auto-detects the form's name if it's not set and sets the form's name using `Zend_Form::setName()'.
`Zend_Form::setName()' then filters the form name stripping backslash '\' characters. The first call to `Form::getName()'
did not regard the filtering and thus returned the unfiltered name which led to `Form::wasSent()' returning `false'.

refs #5525
2014-09-01 14:40:45 +02:00
Eric Lippmann f3e74f0f24 library/form: Append class 'autosubmit' in case the element to autosubmit has the class attribute set
Before, the class attribute would've been overwritten.

refs #5525
2014-09-01 09:44:04 +02:00
Johannes Meyer fb5685bac3 Merge branch 'master' into bugfix/rebuild-form-builder-5525
Conflicts:
	application/forms/Config/Authentication/BaseBackendForm.php
	application/forms/Config/Authentication/DbBackendForm.php
	application/forms/Config/Authentication/LdapBackendForm.php
	application/forms/Config/Authentication/ReorderForm.php
	application/forms/Config/LoggingForm.php
	application/forms/Config/ResourceForm.php
	application/forms/Preference/GeneralForm.php
	library/Icinga/Application/Config.php
	library/Icinga/Web/Form.php
	modules/monitoring/application/controllers/ConfigController.php
	modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php
	modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php
	modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php
	modules/monitoring/application/forms/Config/SecurityForm.php
2014-08-29 16:05:56 +02:00
Johannes Meyer 79b0ed64ec Make it possible to provide a closure to be called instead of onSuccess()
This allows us to write generic forms like the ConfirmRemoval form but to
utilize handleRequest() while providing a closure in the array that is passed
to a form's constructor.

refs #5525
2014-08-29 12:21:31 +02:00
Johannes Meyer bf23688e73 Make autosubmit work in non-JS enviroments
We require forms to set autosubmit=true on elements which are supposed
to be submitted automatically now. The base form then ensures that this
works in JS environments and non-JS environments as well by applying the
right changes to the HTML.

refs #5525
2014-08-29 09:08:53 +02:00
Johannes Meyer 486104d59e Check explictly for FALSE when calling onSuccess()
This allows us to just end onSuccess() without requiring it to return TRUE
to initiate redirection.

refs #5525
2014-08-29 09:04:20 +02:00
Matthias Jentsch 3642b7b6fc Adjust CSS for inlinePies to be centered on the current line 2014-08-28 18:27:30 +02:00
Alexander Klimov 45638b218c Throw IcingaException rather than Exception
fixes #7014
2014-08-27 16:03:15 +02:00
Alexander Klimov 7ff51caed0 Remove leading backslashes from the targets of use statements
- use \Exception;
+ use Exception;
2014-08-27 15:51:49 +02:00
Alexander Fuhr 236d384bab Fixes unaccepted behavior in module configuration
fixes #7011
2014-08-27 14:57:08 +02:00
Johannes Meyer e1329058db Do not hard code the name of the form identification element
Like the csrf element name the form identification element name should
be publicly accessible as well.

refs #5525
2014-08-27 13:14:40 +02:00
Eric Lippmann 1dea19504f Revert "Remove leading backslashes from the targets of use statements"
This reverts commit 87a5967501.

At least 'modules/doc/run.php' issues a warning about "The use statement with non-compound name 'Zend_Controller_Router_Route' has no effect"
2014-08-27 12:24:11 +02:00
Marius Hein 88698cb05d Hook/TopBar: Rework interface for monitoring top bar
refs #6929
2014-08-27 11:31:48 +02:00
Marius Hein b7ae66b496 Hook: Add web hook base class
refs #6929
2014-08-27 11:31:47 +02:00
Marius Hein e0d7c3855d Hook: Add class suffix for base class testing
refs #6928
2014-08-27 11:31:47 +02:00
Alexander Klimov 87a5967501 Remove leading backslashes from the targets of use statements
- use \Exception;
+ use Exception;
2014-08-27 11:16:44 +02:00
Marius Hein 5abf41edef Hook/ConfigurationTab: Remove deprecated implementation
ConfigurationTab hook is not used anywhere. Test is
removed also.
2014-08-27 10:29:04 +02:00
Johannes Meyer 6783d51f76 A form is "submitted" when it was "sent" but no submit label was set
This enables us to use handleRequest() as is when no specific submit button
is required.

refs #5525
2014-08-27 10:28:50 +02:00
Johannes Meyer 0ff79b0948 Replace Form::onFailure() with Form::onShow()
There is currently no usecase for onFailure() but for onShow() wherewith
the case is covered when a form needs to be prepared before showing it
to the user while the form was not submitted in any way.

refs #5525
2014-08-27 10:25:50 +02:00
Johannes Meyer d3c2fc858c Access formdata internally using a public helper method
This way concrete form implementations can also simply fetch form
dependent request values without referring to the form's submission
method.

refs #5525
2014-08-27 10:19:33 +02:00
Johannes Meyer 65dd3f9a5b Make the form in view scripts accessible using $form instead of $element
refs #5525
2014-08-27 10:10:55 +02:00
Johannes Meyer 98b2bce15e Icinga\Web\Form::onSuccess() must not return TRUE
When using Icinga\Web\Form directly without creating a specific sub-class
and calling handleRequest() one must not get redirected.

refs #5525
2014-08-27 10:09:29 +02:00
Marius Hein 7e5b5a0b30 Hook/Grapher: Rework hook interface
Rework interface based on specification and changed consumer calls.

refs #6932
2014-08-27 09:35:43 +02:00
Marius Hein 376e9aa160 Rename hook base classes
Adding suffix "Hook" to every base class. This simplifies development
because you don't need to alias bases classes in your concrete
hook classes

refs #6928
2014-08-26 14:29:55 +02:00
Johannes Meyer 45cbd3f067 We do not require the request being passed to handleRequest()
refs #5525
2014-08-26 12:31:05 +02:00
Johannes Meyer 5c7999fe9b Forms should be responsible for any redirection as well
If no specific url has been set with setRedirectUrl() a form redirects to the
current action it was posted to.

refs #5525
2014-08-26 12:30:37 +02:00
Alexander Klimov 1f7d4cb61b Merge branch 'master' into bugfix/exceptions-with-printf-params-6931 2014-08-26 11:24:33 +02:00
Alexander Klimov febb2d1ae2 ProgrammingError: extend IcingaException
refs #6931
2014-08-26 11:15:19 +02:00
Alexander Fuhr 42e2b34356 Implement self provided configuration for dashboard/dashlets in modules
refs #6639
2014-08-26 10:34:36 +02:00
Johannes Meyer 52534a2f46 It is a form's responsibility to process the request it was submitted with
How forms are being validated should not be a task that is part of the
controller action, but should be handled by the form base class as it is
most of the time the same procedure. Now a controller action just sets
up the form to use, calls handleRequest() and acts upon its return value.
(e.g. calling handleRequest() from another form or any redirection)

refs #5525
2014-08-25 17:06:45 +02:00
Johannes Meyer c93ab7951d Check whether a form's data was sent instead of whether it's complete
It is not sufficient to just check whether all required elements are being
submitted. We definetely need to check whether the submit button was
pressed. But doing this and providing a standard button with a static name
simultaneously will produce conflicts if forms are using the same action
urls. To fix this, we'll add an additional form-identification check by using
a form's name or class.

refs #5525
2014-08-25 16:49:54 +02:00
Johannes Meyer 7b221e2aba It should not be a form's responsibility how its submit button should look..
...in case it's a standard button. No need to be DRY here.

refs #5525
2014-08-22 15:20:54 +02:00
Johannes Meyer 2b879b344f Do not populate using createElements() and fix documentation blocks
refs #5525
2014-08-22 12:04:14 +02:00
Alexander Klimov 9c5878cbbe ConfigurationError: extend IcingaException
refs #6931
2014-08-22 11:46:11 +02:00