gpt4 book ai didi

sugarcrm - 在 SugarCRM 自定义模块中创建文件类型字段

转载 作者:行者123 更新时间:2023-12-02 19:11:07 32 4
gpt4 key购买 nike

我有一个自定义模块样本管理。我想在 editviewdef.php 中创建一个文件类型字段,以便我可以在需要时上传文件并从详细 View 下载它。有人能告诉我如何继续执行此任务的步骤吗?

最佳答案

如果您通过模块生成器创建模块,只需将 'file' => 1, 添加到 $config 变量 (config.php) 中的 'templates' 数组中。然后您就可以将新的上传文件字段添加到 editviewdefs.php 中:

      1 =>
array (
'name' => 'uploadfile',
'displayParams' =>
array (
'onchangeSetFileNameTo' => 'document_name',
),
),

不要忘记将表单和 javascript 元素添加到 editviewdefs.php 中的 templateMeta 数组中:

  'form' =>
array (
'enctype' => 'multipart/form-data',
'hidden' =>
array (
),
),
'javascript' => '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/sugar_grp_jsolait.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="modules/Documents/documents.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>',

您还需要将 uploadfile 字段添加到detailvidefs.php:

      1 =>
array (
'name' => 'uploadfile',
'displayParams' =>
array (
'link' => 'uploadfile',
'id' => 'id',
),
),

希望这有帮助!

关于sugarcrm - 在 SugarCRM 自定义模块中创建文件类型字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5547886/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com