firesphere/partialuserforms

存储部分用户表单提交

安装次数: 580

依赖项: 0

建议者: 0

安全: 0

星级: 5

关注者: 4

分支: 8

开放问题: 33

类型:silverstripe-vendormodule


README

CircleCI codecov Scrutinizer Code Quality

部分用户定义表单提交

本模块旨在存储用户表单的部分提交,适用于用户定义表单有多个“页面”的情况。

当表单完成时,部分将被存储和删除。

安装

composer require firesphere/partialuserforms

使用方法

部分表单提交存储在数据库中,并在CMS表单中可见。

通过在表单上勾选复选框并在设置中设置配置,可以获得每日部分提交的导出。

要求

  • UserDefinedForms 5+
  • SilverStripe Recipe CMS 1+
  • QueuedJobs 4+

开发要求

  • PHPUnit
  • 立即异常打印器
  • PHP CodeSniffer

与Elemental UserForms一起使用

将以下内容添加到您的config yml中

DNADesign\ElementalUserForms\Model\ElementForm:
  extensions:
    - Firesphere\PartialUserforms\Extensions\UserDefinedFormExtension
    

扩展

为了管理发送的CSV,例如过滤某些值或从CSV中删除记录,导出作业有一个名为updateCSVRecords的扩展点,在其中可以过滤记录,例如。

class PartialSubmissionJobExtension extends Extension
{

    /**
     * Remove records that do not have an email address
     * to reduce the amount of useless records
     * @param $csvArray
     * @param $editableFields
     */
    public function updateCSVRecords(&$csvArray, $editableFields)
    {
        $emailAddress = array_search('email_address', array_keys($editableFields));
        foreach ($csvArray as $key => $value)
        {
            if (empty($value[$emailAddress])) {
                unset($csvArray[$key]);
            }
        }
    }
}

好处

使用部分表单,部分提交对CMS用户可用,以查看访客在表单中走了多远,并可选地给用户打电话,询问他们为什么放弃。

进一步改进

  • 将部分表单保存到LocalStorage中,以启用表单的预填充
  • 从服务器检索部分表单,以启用表单的预填充
  • JS测试覆盖率

实际许可证

此模块根据BSD 3条款许可证发布,尽管这些许可证不适用于实际类,但许可证仍然适用

https://open-source.org.cn/licenses/BSD-3-Clause

版权 (c) 2012-NOW(), Simon "Firesphere" Erkelens

版权所有。

重新分发和使用源代码和二进制代码,无论是否修改,只要满足以下条件

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

本软件由版权所有者和贡献者“按原样”提供,并不承担任何明示或暗示的保证,包括但不限于适销性和针对特定目的的适用性的暗示保证。在任何情况下,版权所有者或贡献者均不对任何直接、间接、偶然、特殊、示范性或后果性的损害(包括但不限于替代商品或服务的采购;使用、数据或利润的损失;或业务中断)承担责任,无论何种原因造成,无论是在合同、严格责任或侵权(包括疏忽或其他)中,即使被告知该软件存在此类损害的可能性。

你阅读了整个README吗?你太棒了!

下面有一头牛,专门为你。


               /( ,,,,, )\
              _\,;;;;;;;,/_
           .-"; ;;;;;;;;; ;"-.
           '.__/`_ / \ _`\__.'
              | (')| |(') |
              | .--' '--. |
              |/ o     o \|
              |           |
             / \ _..=.._ / \
            /:. '._____.'   \
           ;::'    / \      .;
           |     _|_ _|_   ::|
         .-|     '==o=='    '|-.
        /  |  . /       \    |  \
        |  | ::|         |   | .|
        |  (  ')         (.  )::|
        |: |   |;  U U  ;|:: | `|
        |' |   | \ U U / |'  |  |
        ##V|   |_/`"""`\_|   |V##
           ##V##         ##V##