intotheweb101/partialuserforms

firesphere/partialuserforms 扩展 - 存储部分用户表单提交

安装: 124

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 8

类型:silverstripe-vendormodule

0.20 2018-12-20 00:34 UTC

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-clause许可协议下发布,尽管这些许可协议不在实际类中,但许可协议仍然适用

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##