【问题标题】:Use webform submission id in custom content type在自定义内容类型中使用 webform 提交 ID
【发布时间】:2014-01-24 02:58:32
【问题描述】:

我正在开展一个患者/医生类型的项目,患者填写问卷,然后医生开出处方。

我使用网络表单模块创建了患者将填写的问卷,并且我为处方创建了自定义内容类型。

我正在开展一个患者/医生类型的项目,患者填写问卷,然后医生提供相应的处方。 我使用 Webform 模块来创建患者填写的问卷。我已经为处方创建了一个自定义内容类型。

我需要能够将问卷的提交 ID 与处方相关联,但我不知道该怎么做。

我已经尝试过节点参考模块,但这只能让我访问调查问卷,而不是调查问卷的提交 ID。

请注意,患者可以填写各种问卷,因此我使用提交 ID 非常重要,因为它似乎是唯一可用的唯一 ID。 需要能够将问卷的提交 ID 与处方相关联,但我不知道该怎么做。

我已经尝试过节点参考模块,但这只能让我访问调查问卷,而不是调查问卷的提交 ID

【问题讨论】:

    标签: drupal-7 drupal-views drupal-webform drupal-content-types


    【解决方案1】:

    有功能

    function modulename_webform_submission_insert($node, $submission) {
     // $node will give you the node id of your webform
     // $submission will give you the id of your data which you inserted in web form
    }
    This function is called just after you insert data through web form. Here you can perform whatever task you want by using those two node and submission id's.
    

    【讨论】:

    • 这个功能我还没试过。但是我找到了一个解决方案,它是使用 Entityforms 而不是 webforms 并解决了这个问题。
    【解决方案2】:

    实体表单模块和实体引用提供了所需的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-08
      • 2012-09-03
      • 1970-01-01
      • 1970-01-01
      • 2012-02-19
      • 1970-01-01
      • 2020-04-03
      • 1970-01-01
      相关资源
      最近更新 更多