Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
devel:documentation:bulk_actions:dev:bulk_actions [2020/02/07 09:20] husniko [How can I add new bulk action?] |
devel:documentation:bulk_actions:dev:bulk_actions [2020/10/15 05:38] (current) husniko [How can I add support for bulk action?] |
||
---|---|---|---|
Line 16: | Line 16: | ||
Every agenda is allowed to have more implemented bulk actions for different purposes. It is possible to combine all selection strategies. First two selection strategies are controlled by another method '' | Every agenda is allowed to have more implemented bulk actions for different purposes. It is possible to combine all selection strategies. First two selection strategies are controlled by another method '' | ||
+ | Available bulk actions are shown with respect currently logged user authorities - required authority can be specified in bulk action '' | ||
After that controller receives a new bulk action request (rest post method), it transforms given map< | After that controller receives a new bulk action request (rest post method), it transforms given map< | ||
Line 82: | Line 83: | ||
</ | </ | ||
+ | |||
+ | ===== Configuration ===== | ||
+ | {{tag> configuration }} | ||
+ | |||
+ | @since 10.6.0 | ||
+ | |||
+ | Bulk action order, icon, level and other properties can be configured by [[..: | ||
+ | |||
+ | Available bulk action can be shown in bulk action agenda available from menu - Settings - Modules - Bulk actions | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <note tip>All configurable properties (e.g. order) are shown in frontend agenda. Bulk Action can be disabled (or enabled) directly from this agenda (other configurable properties will be added in future).</ | ||
Line 91: | Line 105: | ||
* **getName** - name of bulk action, it will be used as key in localization | * **getName** - name of bulk action, it will be used as key in localization | ||
* **getAuthoritiesForEntity** - required permissions for processing of entities | * **getAuthoritiesForEntity** - required permissions for processing of entities | ||
- | * **getOrder** - order in selecbox | + | * **getOrder** - order in selectbox |
* **getService** - the service, items of which are processed by bulk action | * **getService** - the service, items of which are processed by bulk action | ||
- | |||
* **processEntities** - iterates over all selected items and is supposed to provide check of permissions and processing invocation | * **processEntities** - iterates over all selected items and is supposed to provide check of permissions and processing invocation | ||
* **processDto** - is called by processEntities method and implements processing of every single item | * **processDto** - is called by processEntities method and implements processing of every single item | ||
+ | * **getLevel** - level for bulk action button (success by default) | ||
+ | * **isDeleteAction** - false by default. Action deletes records (for FE only). Action will be in bottom menu section, is action is included in menu. | ||
+ | * **isQuickButton** - false by default. Render action as quick button (for FE only). The first available actions are rendered as buttons, if icon is defined. This configuration enforces rendering action as quick button (order is ignored). | ||
- | If you want use some settings | + | If one wants to use some settings |
- | <note tip>For all bulk actions | + | <note tip>Bulk actions |
- | After you implement | + | After implementation of all BE parts enabling support of the required bulk action, it is also necessary |
+ | Form attribute localization parts are placed | ||
+ | |||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
===== How can I add support for bulk action? ===== | ===== How can I add support for bulk action? ===== | ||
- | When we need add new agenda that will be support bulk actions | + | In order to add support |
- | - implements two method' | + | - in BE controller |
- | * **getAvailableBulkActions** - return | + | * **getAvailableBulkActions** - returns |
- | * **bulkAction** - process | + | * **bulkAction** - processes |
- | * **prevalidateBulkAction** - prevalidate | + | * **prevalidateBulkAction** - invokes |
- | - into frontend | + | - in FE service |
- | * **supportsBulkAction**=true | + | * **supportsBulkAction** - has to return |
+ | * **showRowSelection** - this '' | ||
- | Now you can start use bulk actions. | + | Now you can start using bulk actions. |