lavitto/typo3-form-to-database

Extends the TYPO3 form with a database finisher, to save every form-result in the database.

Installs: 231 201

Dependents: 0

Suggesters: 0

Security: 0

Stars: 12

Forks: 33

Type:typo3-cms-extension

4.1.0 2024-07-30 14:10 UTC

README

Donate Latest Stable Version TYPO3 License

This extension adds an additional finisher to the TYPO3 Form (tx_form) to save the results into the database

Compatibility

Form to DatabaseTYPO3 Version
4.x12.4
3.x11.5
2.x9.5 - 10.4

Introduction

Features

  • No configuration needed
  • No database-changes per form required
  • Shows all results per form in a separate backend module
  • Provides a CSV-download of all results
  • Automatic deletion of results after a specified number of days (GDPR)
  • Preview & PDF download of individual form results

Screenshots

Backend Overview

Backend Overview

Backend Results

Backend Results

Installation

Installation using Composer

The recommended way to install the extension is by using Composer. In your Composer based TYPO3 project root run composer req lavitto/typo3-form-to-database.

Installation from TYPO3 Extension Repository (TER)

Download and install the extension form_to_database with the extension manager module.

Setup & Usage

Finisher

To start storing form results:

  1. Install the extension
  2. Edit the form you wish to store results for
  3. Add the finisher ("Save the mail to the Database") to your form - it is recommended you place this finisher first

Command / Scheduler

It's possible to delete the form results by the command line or scheduler (Execute console commands).

Usage:
  form_to_database:deleteFormResults [<maxAge>]

Arguments:
  maxAge                Maximum age of form results in days [default: 90]

Customise

There are several options available for customisation. To change these, go to Settings -> Configure Extensions -> form_to_database

  • General
    • hideLocationInList - Should the location of the form be hidden on the Form results overview module? (Default: No)
  • CSV Settings
    • csvDelimiter - What character should separate fields in the CSV export (Default: ,)
    • csvOnlyFilenameOfUploadFields - Should the CSV list the whole path or just the file name?

Single View PDF

Each form response can be downloaded as a PDF which can be customised in TypoScript if mPDF is installed.

TO utilise this feature, install mPDF as an additional dependency

composer req mpdf/mpdf

Settings can be directly passed in to mPDF by using

module.tx_formtodatabase_web_formtodatabaseformresults.settings.pdf.config

The defaults are the following, however they can be overwritten:

'default_font_size' => '12',
'format' => 'A4',
'orientation' => 'P',
'margin_left' => '15',
'margin_right' => '15',
'margin_bottom' => '15',
'margin_top' => '15',
'tempDir' => Environment::getVarPath() . '/form_to_database'
Stylesheets

If you wish to pass in a custom CSS stylesheet, you can do so with the following:

module.tx_formtodatabase_web_formtodatabaseformresults.settings.pdf.stylesheet {
  link = EXT:your_extension/Resources/Public/Css/print-form-to-database.css
  media = all
}
Letterheads

Letterheads can add information to the top and bottom of each page, it uses SetHTMLHeader and SetHTMLFooter directly.

This means all the mPDF variables are accessible. These can be added via TypoScript (letterheads.header and letterheads.footer). For example:

module.tx_formtodatabase_web_formtodatabaseformresults.settings.pdf.letterheads.footer (
  <table class="footer"><tr><td>Form to Database - {PAGENO}/{nbpg}</td></tr></table>
)

Contribute

Please create an issue at https://gitlab.com/lavitto/typo3-form-to-database/issues.

Please use GitLab only for bug-reporting or feature-requests. For support use the TYPO3 community channels or contact us by email.

Commits should follow TYPO3 Commit Guidelines.

Support

If you need private or personal support, try the TYPO3 Slack channel - #ext-form-to-database or contact us by email on info@lavitto.ch.

Be aware that this support might not be free!