Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define export fields based on form #131

Open
kszymukowicz opened this issue Feb 7, 2022 · 5 comments
Open

Define export fields based on form #131

kszymukowicz opened this issue Feb 7, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@kszymukowicz
Copy link

hi
I can not find in docs and from the code looks like its not possible to define export fields based on form.
Do you have some nice trick for that?

@mbrodala
Copy link
Member

mbrodala commented Feb 7, 2022

What do you mean exactly with that?

Maybe related to #17

Here you can see that it's not that easy to implement but maybe you have a good idea.

@kszymukowicz
Copy link
Author

kszymukowicz commented Feb 12, 2022

Sorry for late response. I was trying to find the best solution.

Actually I was inspired by the conditions here #15 and I have made a condition per form identifier like below. This solves my issue. If you want I can make a PR with docs for that solution or maybe you want to solve that possibility differently? For example by defining some way to inject TS per form identifier on TS level. (f.e. something like module.tx_formlog.settings.list._form-identifier.f1-5685 { })

My working solution:

[traverse(request.getQueryParams(), 'tx_formlog_web_formloglist/filters/identifier/value') == 'f1-5685']
    module.tx_formlog {
        settings {
            list {
               // some custom columns settings per form
            }
            export < .list
        }
    }
[global]

The idea of #17 is nice however. I suppose when my PMs will start to make own form they will need that definitely.

@mbrodala
Copy link
Member

Your workaround may work but it relies on two facts which cannot be taken as given:

  1. Log entries of a single form are listed
  2. The form definition never changes

By default we the list contains entries of all forms mixed, filtering by a single identifier may open up the path for exporting entries of a single form. But that form definitions may change cannot be avoided; the same form identifier can contain slightly or even completely different fields over time.

Thus this requires a good concept for a general solution which covers the most cases.

@mbrodala
Copy link
Member

Giving this another thought the suggested TypoScript setup could indeed help to get this achieved.

Currently we have this:

module.tx_formlog.settings.list.columns
module.tx_formlog.settings.export.columns

Another option could be added to specify dedicated columns for each form identifier:

module.tx_formlog.settings.list.columns
module.tx_formlog.settings.export.columns

module.tx_formlog.settings.form.<identifier>.list.columns
module.tx_formlog.settings.form.<identifier>.export.columns

This could then prefer the 2nd paths if only entries from the form <identifier> are to be listed; we can determine this from the fact that the matching filter is applied. Tasks for this:

  1. Introduce the new settings path
  2. Have the dedicated columns respected in the list
  3. Have the dedicated columns respected in the export
  4. Add an indicator to the log module if form-specific column settings are used (hopefully reduces confusion about varying display and export)

@mbrodala mbrodala added the enhancement New feature or request label Feb 18, 2022
@kszymukowicz
Copy link
Author

Yes - that will solve the issue and your TS settings proposal is better than mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants