Download the PHP package se7enxweb/bccie without Composer
On this page you can find all versions of the php package se7enxweb/bccie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download se7enxweb/bccie
More information about se7enxweb/bccie
Files in se7enxweb/bccie
Package bccie
Short Description Exponential extension that exports the information collected by forms to CSV and SYLK (Excel) files: an admin dashboard, exports in the background, console commands and cronjob parts.
License GPL-2.0-or-later
Homepage https://github.com/se7enxweb/bccie
Informations about the package bccie
BC CIE: collected information export for Exponential
BC CIE exports the information that the forms of an Exponential site collect (contact forms, polls, sign-up and feedback forms: any content object with information-collector fields) to CSV or SYLK files that open in Excel, LibreOffice Calc or Numbers. It is for site administrators and editors who need the submissions of a form as a spreadsheet, and for developers who want the same export from the console or from cron.
What you get:
- A CIE tab in the administration (admin4 draws it with the
arrow-down-upicon) with a dashboard of every form that has collected information, the last exports and the problems the extension finds in its settings. - An export page per form: choose the fields, the date range, CSV or SYLK, the separator and the character set.
- Small exports are written while you wait; large ones run in the background and are offered for download when done.
- An Export link per form on the kernel's collected-information overview (
infocollector/overview) and an Export Collection button on its collection list (infocollector/collectionlist). - Console commands and two cronjob parts for scheduled exports, with an optional removal of what was exported.
- Spreadsheet safety: a text cell that starts with
=,+,-or@gets a leading single quote, so a spreadsheet does not run it as a formula. - Translations for 19 locales.
Requirements
- Exponential 6.0.15 or later. The module views, the cronjob parts and the console commands are built on the
kernel's
Exponential\Runnableclasses that 6.0.15 introduced. (Exponential 4.x kernels ran the 1.0 and 1.1 releases up to 1.1.11.) - PHP 8.0 or later.
- The ezjscore extension, which ships with the kernel (the pages load their script and style through it).
- For exports in the background:
proc_open,setsidand the PHP command line on the server. Without them, admin exports are limited toDirectExportLimitcollections and the dashboard says so.
Installation
With Composer
From the root of your Exponential installation:
The legacy extension installer puts the files in extension/bccie.
By hand
Download a release from https://github.com/se7enxweb/bccie/releases (or
git clone https://github.com/se7enxweb/bccie.git extension/bccie) and place it so that the files are in
extension/bccie of your installation. The folder must be called bccie.
Then, either way
-
Activate the extension in
settings/override/site.ini.append.php: -
Regenerate the autoloads and clear the caches:
- Give the roles that should export the policy
bccie/read(see Permissions). Administrators with all rights have it already.
The CIE tab now shows in the administration's top menu.
If one of your siteaccesses keeps its own
menu.ini.append.phpwith a[TopAdminMenu] Tabs[]list, addTabs[]=bccie_overviewto it.
Usage
In the administration
- Click the CIE tab (
/bccie/overview). The start page lists every form that has collected information, with the number of collections and the date of the last one, the last exports, and the problems found (for example a scheduled export without objects, or one that removes what it exported). - Click a form (
/bccie/export/<object id>). Choose:- Fields: the collection ID, each field of the form, and optionally the creation and modification dates. A field whose datatype has no export handler exports its stored text.
- Date range: a start and an end date; empty dates mean no limit.
- Export type: CSV or SYLK (Excel).
- Character set:
utf8(default),utf8bom(Excel on Windows),utf16le(Excel on macOS) orcp1252. - Separation char for CSV: semicolon, comma, colon, pipe or hash.
- Click Do export. An export of up to
DirectExportLimitcollections (2000 by default) is downloaded at once. A larger one runs in the background: the page follows its progress (bccie/job) and offers the file for download (bccie/download) when it is done. Only the user who started an export can see its state and download its file, and only while that user can still read the form. - A user with
bccie/removealso sees Remove all collected information. It removes every collection of the form; the form itself stays. Export the data first.
You can also start from the kernel's Collected information pages: the overview has an Export link per form and the collection list of a form an Export Collection button; both open the same export page.
From the console
ext:bccie:export also takes --to=YYYY-MM-DD, --fields=contentobjectid,<attribute ids> (-1 adds an empty
column, -2 skips one), --creation-date, --modification-date and --remove-exported. Every command lists its
options with --help. Without ./console, run the scripts directly, for example
php extension/bccie/bin/php/export.php --object=123.
Scheduled exports (cron)
The cronjob parts exportcsv and exportsylk export every object listed in [CieSettings] Collection[] to
[CieSettings] Directory, the same as ./console ext:bccie:export --cron:
A crontab line that exports every night at 02:30:
The shell scripts in bin/ (runcronjobpart.sh, runcronjobpartcsv.sh, runcronjobpartsylk.sh) run a part by
hand from the installation's root and write its output to var/log/cie.log.
Configuration
Copy the settings you want to change into settings/override/cie.ini.append.php (or a siteaccess's settings
folder). The defaults are in extension/bccie/settings/cie.ini.append.php.
Datatypes and export handlers
export.ini lists the datatypes that are exported ([General] ExportableDatatypes[]) and, per datatype, the
handler class that turns a value into a cell. The handlers are in extension/bccie/classes/handlers/. Supported out
of the box: ezboolean, ezcountry, ezdate, ezdatetime, ezemail, ezenhancedobjectrelation, ezfloat,
ezidentifier, ezinteger, ezobjectrelation, ezoption, ezselection, ezstring, eztext, eztime, ezurl,
ezxmltext, and the third-party owenhancedselection, smileobjectrelationlist and ezbirthday. For the object
relation datatypes, OutputRelatedObjectNames=false in their block exports the IDs instead of the names.
To export a datatype of your own, write a handler that extends BaseHandler (see ezexamplecustomhandler.php),
put it in extension/bccie/classes/handlers/ or a folder below it:
and register it in settings/override/export.ini.append.php:
Character set handlers
A character set is a class named in ExportOutputFormatHandlers[] that extends
bccieExportFormatOutputHandler; the four in classes/exportFormatOutputHandlers/ are examples.
Permissions
The module bccie has two functions (modules/bccie/module.php):
| Function | Allows |
|---|---|
bccie/read |
The CIE tab, the overview, the export pages, background exports and their downloads |
bccie/remove |
Removing the collected information of a form (with bccie/read) |
The kernel's Collected information pages need infocollector/read, as before. The views are not open to
anonymous users: settings/site.ini.append.php explains why its PolicyOmitList[] lines stay commented out.
Upgrading
Replace the files in extension/bccie (or run composer update se7enxweb/bccie), regenerate the autoloads and
clear the caches as in Installation. Keep your changes in settings/override, never in the
extension's own settings. The changes of each release are in doc/changelogs.
Known limits
- An export reads the stored data of each field; a datatype without a handler exports its stored text.
- A background job written by a version before 1.1.18 has no owner and can no longer be opened or downloaded; it is pruned as before.
Troubleshooting
- The CIE tab is missing: check that the extension is active, that the autoloads were regenerated, that the
user has
bccie/read, and that a siteaccessmenu.ini.append.phpdoes not replace the tab list. - Accented characters look wrong in Excel: export with
utf8bomon Windows orutf16leon macOS. - The scheduled export writes nothing: run
./console ext:bccie:export --cron --dry-run; it says whenCollection[]is empty../console ext:bccie:statuslists the problems the dashboard shows. - More answers are in doc/FAQ.md.
Development and tests
The PHPUnit tests in tests/ read the sources and need neither a kernel nor a database. From the installation's
root:
Issues and pull requests are welcome at https://github.com/se7enxweb/bccie.
License
GNU General Public License v2.0 or (at your option) any later version. See LICENSE and COPYRIGHT.md.
Credits and history
BC CIE was written in 2006 by Mathias Vitalis, inspired by the CSV export module of Gabriel Ambuehl, and was developed and maintained by Brookins Consulting for eZ Publish, the system Exponential grew out of, until 2017. 7x maintains it for Exponential. See doc/CREDITS.md.