CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #7070

Enable TSconfig configuration for module

Added by Felix Nagel about 3 years ago. Updated over 2 years ago.

Status:Resolved Start date:2010-03-30
Priority:Should have Due date:
Assignee:Reinhard Führicht % Done:

100%

Category:Backend Module
Target version:Beta 5 (v0.9.8)
Votes: 0

Description

I needed some configuration to restrict access via formhandler module to specific pages (aka forms) and to make the generation of pdf/csv more configurable.
With the attached changes its possible to restrict access to mails, choose and order the fields within the pdf or csv via formhandler module (no more manual selection of the fields). This functionality is inspired by powermail and could be useful for non admin users.

Please see description of the files. TSconfig should look like this:

tx_formhandler_mod1.config {
   filter = 69, 53
   csv = salutation, name, company, street, plz, city, phone
   pdf = ip, submission_date, salutation, name, company, street, plz, city, phone
}

Possible to xclass?
This question is obsolete if these changes will be integrated in formhandler:
I tried to xclass formhandler to implement above mentioned functionality, but i did not succeed. No problem to use own classes in FE validation (initInterceptors, preProcessors, etc.) but i in BE?
I succeed to extend Classes\Controller\Module\index.php via xlcass to use a modified Tx_Formhandler_Controller_Backend class, but it seems its currently not possible to set different directory in which ComponentManger searchs for this class. Any idea how to do this?

Tx_Formhandler_Controller_Backend.php - Edited functions: generatePDF, generateCSV, buildWhereClause (31 kB) Felix Nagel, 2010-03-30 12:03

Tx_Formhandler_Generator_CSV.php - Edited functions: generateModuleCSV (4.6 kB) Felix Nagel, 2010-03-30 12:03

Tx_Formhandler_Controller_Backend.diff (3.5 kB) Felix Nagel, 2010-04-09 17:17

Tx_Formhandler_Generator_CSV.diff (877 Bytes) Felix Nagel, 2010-04-09 17:17

formhandler_module_ext.diff (32.4 kB) Felix Nagel, 2010-07-14 21:17

formhandler_module_extended.zip (18.2 kB) Felix Nagel, 2010-07-14 21:17

ts_config_fix.patch (3 kB) Felix Nagel, 2010-08-26 15:27

History

Updated by Reinhard Führicht about 3 years ago

Please provide the changes as a patch file, so I can identify the changes much easier and patch Formhandler automatically.

Updated by Felix Nagel about 3 years ago

I pulled latest svn trunk and did a diff with svn merge -- hope that helps.

Updated by Felix Nagel about 3 years ago

Small update:

If you use TSconfig to limit the users possibilities you might want to disable the "clear log" function in formhandler module, too.

You could use:

mod.web_txformhandlermoduleM1.menu.function.2 = 0

to disable it.

Perhaps this should be added to the doc.

Updated by Felix Nagel almost 3 years ago

Finally I added pagination to this little improvement. Pagination is based upon the extension bepagination (http://typo3.org/extensions/repository/view/bepagination/current/). This patch inlcudes the above mentioned changes, which enable you to pre-order the fields within the pdf or csv (no more manual selection of the fields via formhandler module).

Config
Use this TS config within a page, a user or a user group

tx_formhandler_mod1.config {
   # add your fieldnames in needed order
   csv = salutation, name, company, street, plz, city, phone
   pdf = ip, submission_date, salutation, name, company, street, plz, city, phone
}

Please take a look at my comment above to learn how to disable mod2 (truncate table).

Patch
Patches based upon formhandler 0.9.7

Using the zip: Just copy the files in the zip in your formhandler directory -- thats it.

Using the diff: I provide a unified patch as described here: http://typo3.org/development/bug-fixing/diff-and-patch/
You need to add the file class.tx_formhandler_mod1_pagination.php in typo3conf/ext/formhandler/Classes/Controller/Module/ (its in the zip).

Updated by Reinhard Führicht almost 3 years ago

Hi Felix,

I just tested your patch.
I need to make a few more ajustments to make it work with the current trunk version, but it looks great at first glance!!!

Stay tuned!

Updated by Reinhard Führicht almost 3 years ago

The patch works just fine. I was able to make it work (it was my mistake btw. no mistake in the patch).
I would like to change the code a bit to fit the coding style of the rest of the extension. Is this OK for you?

Updated by Felix Nagel almost 3 years ago

Nice to know my patch was alright. Im not quit familiar with diff patches and Dimitry twice wont use my diffs.

No problem, please make some changes to fit the coding style. All i ask for is to implement all new features as i need them in multiple projects.

Updated by Reinhard Führicht almost 3 years ago

The problem with your patch is, that it is not made against the current trunk version. So it is not really possible to patch Formhandler automatically.
I included the patch manually which took some time, but in the end it was worth the effort, because it really works fine.

Updated by Felix Nagel almost 3 years ago

Mhh sorry, i just remember last time :-(
Next patch will be for svn but i always implement feature for our productive version -- which is the lastest in TER.

Updated by Reinhard Führicht almost 3 years ago

One question: I nthe TSconfig you can use:

tx_formhandler_mod1.config.filter = 461,494

But this will never work.
In the code there is a condition checking if the pid filter field is used. It will be used anytime because it gets set to the current page id.
Or have I misunderstood something?

Updated by Felix Nagel almost 3 years ago

AS you can see in comment http://forge.typo3.org/issues/7070#note-4 filter is no longer in use, because its more suitable to configure user rights by using standard TYPO3 group and page restrictions.

Updated by Reinhard Führicht almost 3 years ago

Sorry, I ran through the comment too quickly. So, I can remove the according code from your patch.

Updated by Felix Nagel almost 3 years ago

"So, I can remove the according code from your patch." What do you like to delete?

tx_formhandler_mod1.config.filter was (!) a possibility to restrict access which is not longer needed cause of the remanufacturing of the module. Please do not remove other TS config code which enables user to pre-order the fields in csv/pdf:

tx_formhandler_mod1.config {
   # add your fieldnames in needed order
   csv = salutation, name, company, street, plz, city, phone
   pdf = ip, submission_date, salutation, name, company, street, plz, city, phone
}

Updated by Reinhard Führicht almost 3 years ago

  • Status changed from New to Resolved

Committed to trunk. Thank you very much for the patch. Testing was fine from my side.

Updated by Felix Nagel over 2 years ago

In current trunk version the current page ID is not available via getID().

$controller->setId($this->id);

Function setID is called in line 188 in \Classes\Controller\Module\index.php to set the ID to be available in Tx_Formhandler_Controller_Backend.php. The passed variable $this->id is empty when format selector is displayed. This problem depends on some changes for issue 9328.

Delivered diff contains fixes for above mentioned ID problem, your and my own fix from 9328, a fix for deleting unwanted fields when using TS config as well as a update to the original issue TS configuration patch. New csv lib is missing in this patch, but could be easily provided by me.

Updated by Reinhard Führicht over 2 years ago

Committed to trunk.
Only the changes for Controller_Backend, not for Generator_CSV as they belong to another issue.

Also available in: Atom PDF